Skip to content

Commit

Permalink
audit misuse of string_view
Browse files Browse the repository at this point in the history
  • Loading branch information
gspowley committed Jan 13, 2023
1 parent d905bd9 commit 5151b6f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
16 changes: 8 additions & 8 deletions libtiledbsoma/include/tiledbsoma/soma_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ class SOMAReader {
std::string_view name = "unnamed",
std::map<std::string, std::string> platform_config = {},
std::vector<std::string> column_names = {},
std::string_view batch_size = "auto",
std::string_view result_order = "auto");
std::string batch_size = "auto",
std::string result_order = "auto");

/**
* @brief Open an array at the specified URI and return SOMAReader object.
Expand All @@ -85,8 +85,8 @@ class SOMAReader {
std::string_view uri,
std::string_view name = "unnamed",
std::vector<std::string> column_names = {},
std::string_view batch_size = "auto",
std::string_view result_order = "auto");
std::string batch_size = "auto",
std::string result_order = "auto");

//===================================================================
//= public non-static
Expand All @@ -103,8 +103,8 @@ class SOMAReader {
std::string_view name,
std::shared_ptr<Context> ctx,
std::vector<std::string> column_names,
std::string_view batch_size,
std::string_view result_order);
std::string batch_size,
std::string result_order);

SOMAReader() = delete;
SOMAReader(const SOMAReader&) = delete;
Expand All @@ -121,8 +121,8 @@ class SOMAReader {
*/
void reset(
std::vector<std::string> column_names = {},
std::string_view batch_size = "auto",
std::string_view result_order = "auto");
std::string batch_size = "auto",
std::string result_order = "auto");

/**
* @brief Set the dimension slice using one point
Expand Down
8 changes: 4 additions & 4 deletions libtiledbsoma/src/pyapi/libtiledbsoma.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ PYBIND11_MODULE(libtiledbsoma, m) {
std::optional<std::vector<std::string>> column_names_in,
py::object py_query_condition,
py::object py_schema,
std::string_view batch_size,
std::string_view result_order,
std::string batch_size,
std::string result_order,
std::map<std::string, std::string> platform_config) {
// Handle optional args
std::vector<std::string> column_names;
Expand Down Expand Up @@ -209,8 +209,8 @@ PYBIND11_MODULE(libtiledbsoma, m) {
std::optional<std::vector<std::string>> column_names_in,
py::object py_query_condition,
py::object py_schema,
std::string_view batch_size,
std::string_view result_order) {
std::string batch_size,
std::string result_order) {
// Handle optional args
std::vector<std::string> column_names;
if (column_names_in) {
Expand Down
16 changes: 8 additions & 8 deletions libtiledbsoma/src/soma_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ std::unique_ptr<SOMAReader> SOMAReader::open(
std::string_view name,
std::map<std::string, std::string> platform_config,
std::vector<std::string> column_names,
std::string_view batch_size,
std::string_view result_order) {
std::string batch_size,
std::string result_order) {
return std::make_unique<SOMAReader>(
uri,
name,
Expand All @@ -62,8 +62,8 @@ std::unique_ptr<SOMAReader> SOMAReader::open(
std::string_view uri,
std::string_view name,
std::vector<std::string> column_names,
std::string_view batch_size,
std::string_view result_order) {
std::string batch_size,
std::string result_order) {
return std::make_unique<SOMAReader>(
uri, name, ctx, column_names, batch_size, result_order);
}
Expand All @@ -77,8 +77,8 @@ SOMAReader::SOMAReader(
std::string_view name,
std::shared_ptr<Context> ctx,
std::vector<std::string> column_names,
std::string_view batch_size,
std::string_view result_order)
std::string batch_size,
std::string result_order)
: ctx_(ctx)
, uri_(util::rstrip_uri(uri)) {
// Validate parameters
Expand All @@ -97,8 +97,8 @@ SOMAReader::SOMAReader(

void SOMAReader::reset(
std::vector<std::string> column_names,
std::string_view batch_size,
std::string_view result_order) {
std::string batch_size,
std::string result_order) {
// Reset managed query
mq_->reset();

Expand Down

0 comments on commit 5151b6f

Please sign in to comment.