Skip to content

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences

Fix a few compile warnings/errors.

Kishore Nallanc698c3be1a0e
diff --git a/include/string_utils.h b/include/string_utils.h
index 5aa182e2..a93c6bff 100644
--- a/include/string_utils.h
+++ b/include/string_utils.h
@@ -1,6 +1,7 @@
#pragma once
#include <string>
+#include <algorithm>
#include <sstream>
struct StringUtils {
@@ -52,7 +53,7 @@ struct StringUtils {
}
std::string::const_iterator substart = s.begin(), subend;
while (true) {
- subend = search(substart, s.end(), delim.begin(), delim.end());
+ subend = std::search(substart, s.end(), delim.begin(), delim.end());
std::string temp(substart, subend);
temp = trim(temp);
diff --git a/src/art.cpp b/src/art.cpp
index 469d5bf8..316bffcf 100644
--- a/src/art.cpp
+++ b/src/art.cpp
@@ -625,9 +625,9 @@ static void* recursive_insert(art_node *n, art_node **ref, const unsigned char *
return old_val;
}
- art_values *old_val = l->values;
+ art_values *ret_val = l->values;
add_document_to_leaf(document, l);
- return old_val;
+ return ret_val;
}
// New value, we must split the leaf into a node4
diff --git a/test/art_test.cpp b/test/art_test.cpp
index e900a79f..dd8f5704 100644
--- a/test/art_test.cpp
+++ b/test/art_test.cpp
@@ -743,11 +743,8 @@ TEST(ArtTest, test_int32_range_hundreds) {
std::vector<std::vector<uint32_t>> values = {{2014, 2015, 2016}, {2015, 2016}, {2016},
{1981, 1985}, {1999, 2000, 2001, 2002}};
- //std::cout << "v: " << values[0][0] << std::endl;
-
for(uint32_t i = 0; i < values.size(); i++) {
for(auto j = 0; j < values[i].size(); j++) {
- std::cout << "v: " << values[i][j] << std::endl;
encode_int32(values[i][j], chars);
doc.id = i;
art_insert(&t, (unsigned char*)chars, CHAR_LEN, &doc, 1);
@@ -760,7 +757,7 @@ TEST(ArtTest, test_int32_range_hundreds) {
return ;
- /*for(uint32_t i = 100; i < 110; i++) {
+ for(uint32_t i = 100; i < 110; i++) {
encode_int32(i, chars);
ASSERT_TRUE(NULL == art_insert(&t, (unsigned char*)chars, CHAR_LEN, &doc, 1));
}
@@ -768,7 +765,7 @@ TEST(ArtTest, test_int32_range_hundreds) {
encode_int32(106, chars);
- int res = art_int32_search(&t, 106, EQUALS, results);
+ res = art_int32_search(&t, 106, EQUALS, results);
ASSERT_TRUE(res == 0);
ASSERT_EQ(1, results.size());
results.clear();
@@ -794,7 +791,7 @@ TEST(ArtTest, test_int32_range_hundreds) {
ASSERT_EQ(6, results.size());
res = art_tree_destroy(&t);
- ASSERT_TRUE(res == 0);*/
+ ASSERT_TRUE(res == 0);
}
TEST(ArtTest, test_int32_negative) {