diff --git a/arangod/FulltextIndex/fulltext-index.c b/arangod/FulltextIndex/fulltext-index.c index ec0293bde1..3171d658e0 100644 --- a/arangod/FulltextIndex/fulltext-index.c +++ b/arangod/FulltextIndex/fulltext-index.c @@ -227,7 +227,7 @@ static void RealAddDocument (FTS_index_t* ftx, FTS_document_id_t docid) { x3zstr = ZStrCons(35); x3zstrb = ZStrCons(35); - for (i = 0; i< nowords; i++) { + for (i = 0; i < nowords; i++) { uint64_t unicode; uint8_t* utf; @@ -636,7 +636,7 @@ static uint64_t FindKKey2 (FTS_real_index* ix, uint64_t* word) { uint64_t bkey; tran = *(word++); - if (tran==0) { + if (tran == 0) { break; } // get the Z-string for the index-2 entry of this key @@ -1264,7 +1264,7 @@ FTS_document_ids_t* FTS_FindDocuments (FTS_index_t* ftx, lasthan = newhan; ndocs++; } - if (odocs==0) { + if (odocs == 0) { break; } ZStrInsert(zstr, docpt, 2); diff --git a/lib/Basics/Utf8Helper.cpp b/lib/Basics/Utf8Helper.cpp index ddff091252..d9a6852a6e 100644 --- a/lib/Basics/Utf8Helper.cpp +++ b/lib/Basics/Utf8Helper.cpp @@ -31,6 +31,7 @@ #ifdef TRI_HAVE_ICU #include "unicode/normalizer2.h" #include "unicode/ucasemap.h" +#include "unicode/brkiter.h" #else #include "string.h" #endif @@ -67,39 +68,6 @@ Utf8Helper::~Utf8Helper () { } } -/* -int Utf8Helper::compareUtf8 (const char* left, size_t leftLength, const char* right, size_t rightLength) { -#ifdef TRI_HAVE_ICU - if (!_coll) { - LOGGER_ERROR << "no Collator in Utf8Helper::compareUtf8()!"; - return 0; - } - - UErrorCode status = U_ZERO_ERROR; - int result = _coll->compareUTF8(StringPiece(left, leftLength), StringPiece(right, rightLength), status); - if(U_FAILURE(status)) { - LOGGER_ERROR << "error in Collator::compareUTF8(...): " << u_errorName(status); - return 0; - } - return result; -#else - if (leftLength == rightLength) { - return memcmp((const void*)left, (const void*)right, leftLength); - } - - int result = memcmp((const void*)left, (const void*)right, leftLength < rightLength ? leftLength : rightLength); - - if (result == 0) { - if (leftLength < rightLength) { - return -1; - } - return 1; - } - return result; -#endif -} -*/ - int Utf8Helper::compareUtf8 (const char* left, const char* right) { #ifdef TRI_HAVE_ICU if (!_coll) { diff --git a/lib/Basics/Utf8Helper.h b/lib/Basics/Utf8Helper.h index f978d253e5..3cd32a5cef 100644 --- a/lib/Basics/Utf8Helper.h +++ b/lib/Basics/Utf8Helper.h @@ -55,6 +55,7 @@ namespace triagens { //////////////////////////////////////////////////////////////////////////////// /// @brief a default helper //////////////////////////////////////////////////////////////////////////////// + static Utf8Helper DefaultUtf8Helper; public: @@ -84,7 +85,7 @@ namespace triagens { //////////////////////////////////////////////////////////////////////////////// /// public functions //////////////////////////////////////////////////////////////////////////////// - + //////////////////////////////////////////////////////////////////////////////// /// @brief compare utf8 strings /// -1 : left < right