Skip to content

Commit

Permalink
More clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
ospfranco committed Dec 17, 2024
1 parent 1eabebc commit 73075f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
14 changes: 2 additions & 12 deletions cpp/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jsi::Value create_js_rows(jsi::Runtime &rt, const BridgeResult &status) {
}

jsi::Value
create_result(jsi::Runtime &rt, BridgeResult status,
create_result(jsi::Runtime &rt, const BridgeResult &status,
std::vector<DumbHostObject> *results,
std::shared_ptr<std::vector<SmartHostObject>> metadata) {
jsi::Object res = jsi::Object(rt);
Expand Down Expand Up @@ -191,7 +191,7 @@ create_result(jsi::Runtime &rt, BridgeResult status,
}

jsi::Value
create_raw_result(jsi::Runtime &rt, BridgeResult status,
create_raw_result(jsi::Runtime &rt, const BridgeResult &status,
const std::vector<std::vector<JSVariant>> *results) {
size_t row_count = results->size();
jsi::Array res = jsi::Array(rt, row_count);
Expand Down Expand Up @@ -296,14 +296,4 @@ int mkdir(std::string const &path) {
return 0;
}

std::vector<std::string> parse_string_list(const std::string &str) {
std::vector<std::string> result;
std::istringstream stream(str);
std::string token;
while (std::getline(stream, token, ',')) {
result.emplace_back(token);
}
return result;
}

} // namespace opsqlite
6 changes: 2 additions & 4 deletions cpp/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ std::vector<JSVariant> to_variant_vec(jsi::Runtime &rt, jsi::Value const &xs);
std::vector<int> to_int_vec(jsi::Runtime &rt, jsi::Value const &xs);

jsi::Value
create_result(jsi::Runtime &rt, BridgeResult status,
create_result(jsi::Runtime &rt, const BridgeResult &status,
std::vector<DumbHostObject> *results,
std::shared_ptr<std::vector<SmartHostObject>> metadata);

jsi::Value create_js_rows(jsi::Runtime &rt, const BridgeResult &status);

jsi::Value
create_raw_result(jsi::Runtime &rt, BridgeResult status,
create_raw_result(jsi::Runtime &rt, const BridgeResult &status,
const std::vector<std::vector<JSVariant>> *results);

void to_batch_arguments(jsi::Runtime &rt, jsi::Array const &batch_params,
Expand All @@ -47,6 +47,4 @@ bool folder_exists(const std::string &name);

bool file_exists(const std::string &path);

std::vector<std::string> parse_string_list(const std::string &str);

} // namespace opsqlite

0 comments on commit 73075f2

Please sign in to comment.