aboutsummaryrefslogtreecommitdiff
path: root/icing/file/file-backed-vector.h
diff options
context:
space:
mode:
authorCassie Wang <cassiewang@google.com>2020-01-08 15:57:57 -0800
committerCassie Wang <cassiewang@google.com>2020-01-09 01:53:36 +0000
commit88a9b37a20d4a601baf3b6ca0cfb1ad826dc7e29 (patch)
tree079657ba93902169139425fd1bb08a93c80de9c2 /icing/file/file-backed-vector.h
parent128c9db88925c8425f2ad81e1d8985461d7ba21a (diff)
downloadicing-88a9b37a20d4a601baf3b6ca0cfb1ad826dc7e29.tar.gz
Pull upstream changes and copy libtextclassifier classes.
Upstream synced @288789500. Copied text_classifier dependencies (hash, status, logging) into icing/. Bug: 146383629 Test: manual - ran 'm -j libicing' with a working Android.bp locally Change-Id: I187a98af95b362745a09d605ed8334a6ff6971bb
Diffstat (limited to 'icing/file/file-backed-vector.h')
-rw-r--r--icing/file/file-backed-vector.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/icing/file/file-backed-vector.h b/icing/file/file-backed-vector.h
index dc8a675..05ad288 100644
--- a/icing/file/file-backed-vector.h
+++ b/icing/file/file-backed-vector.h
@@ -65,8 +65,8 @@
#include <utility>
#include <vector>
-#include "utils/base/status.h"
-#include "utils/base/statusor.h"
+#include "icing/text_classifier/lib3/utils/base/status.h"
+#include "icing/text_classifier/lib3/utils/base/statusor.h"
#include "icing/absl_ports/canonical_errors.h"
#include "icing/absl_ports/status_macros.h"
#include "icing/absl_ports/str_cat.h"
@@ -515,8 +515,7 @@ libtextclassifier3::Status FileBackedVector<T>::GrowIfNecessary(
return libtextclassifier3::Status::OK;
}
- // TODO(cassiewang): Benchmark to see if having ABSL_PREDICT_TRUE is impactful
- if (ABSL_PREDICT_TRUE(num_elements <= header_->num_elements)) {
+ if (num_elements <= header_->num_elements) {
return libtextclassifier3::Status::OK;
}
@@ -671,7 +670,7 @@ libtextclassifier3::StatusOr<Crc32> FileBackedVector<T>::ComputeChecksum() {
template <typename T>
libtextclassifier3::Status FileBackedVector<T>::PersistToDisk() {
// Update and write the header
- ICING_ASSIGN_OR_RETURN(Crc32 checksum, ComputeChecksum());
+ TC3_ASSIGN_OR_RETURN(Crc32 checksum, ComputeChecksum());
header_->vector_checksum = checksum.Get();
header_->header_checksum = header_->CalculateHeaderChecksum();