diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-12-07 00:06:15 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-12-07 00:06:15 +0000 |
commit | c2be20616650e2f8ccb1d592654c08d6fda315ca (patch) | |
tree | 9892cbbd0fb247ce252a38f258e33741ca025a45 /icing/index/main/posting-list-hit-serializer.h | |
parent | 6d51031f6fac465f09e95982b19c4f86c88ee2fa (diff) | |
parent | ad9e08ff59020f5b52410dc093061d8ef715a781 (diff) | |
download | icing-android14-qpr2-s3-release.tar.gz |
Snap for 11186783 from ad9e08ff59020f5b52410dc093061d8ef715a781 to 24Q1-releaseandroid-14.0.0_r37android-14.0.0_r36android-14.0.0_r35android-14.0.0_r34android-14.0.0_r33android-14.0.0_r32android-14.0.0_r31android-14.0.0_r30android-14.0.0_r29android14-qpr2-s5-releaseandroid14-qpr2-s4-releaseandroid14-qpr2-s3-releaseandroid14-qpr2-s2-releaseandroid14-qpr2-s1-releaseandroid14-qpr2-release
Change-Id: Ia93a92877933208d4b5ed5f6473564134928dc04
Diffstat (limited to 'icing/index/main/posting-list-hit-serializer.h')
-rw-r--r-- | icing/index/main/posting-list-hit-serializer.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/icing/index/main/posting-list-hit-serializer.h b/icing/index/main/posting-list-hit-serializer.h index 975b05a..2986d9c 100644 --- a/icing/index/main/posting-list-hit-serializer.h +++ b/icing/index/main/posting-list-hit-serializer.h @@ -23,6 +23,7 @@ #include "icing/file/posting_list/posting-list-common.h" #include "icing/file/posting_list/posting-list-used.h" #include "icing/index/hit/hit.h" +#include "icing/util/status-macros.h" namespace icing { namespace lib { @@ -72,8 +73,9 @@ class PostingListHitSerializer : public PostingListSerializer { // keep_prepended is true, whatever could be prepended is kept, otherwise the // posting list is left in its original state. template <class T, Hit (*GetHit)(const T&)> - uint32_t PrependHitArray(PostingListUsed* posting_list_used, const T* array, - uint32_t num_hits, bool keep_prepended) const; + libtextclassifier3::StatusOr<uint32_t> PrependHitArray( + PostingListUsed* posting_list_used, const T* array, uint32_t num_hits, + bool keep_prepended) const; // Retrieves the hits stored in the posting list. // @@ -312,9 +314,10 @@ class PostingListHitSerializer : public PostingListSerializer { // Inlined functions. Implementation details below. Avert eyes! template <class T, Hit (*GetHit)(const T&)> -uint32_t PostingListHitSerializer::PrependHitArray( - PostingListUsed* posting_list_used, const T* array, uint32_t num_hits, - bool keep_prepended) const { +libtextclassifier3::StatusOr<uint32_t> +PostingListHitSerializer::PrependHitArray(PostingListUsed* posting_list_used, + const T* array, uint32_t num_hits, + bool keep_prepended) const { if (!IsPostingListValid(posting_list_used)) { return 0; } @@ -331,7 +334,7 @@ uint32_t PostingListHitSerializer::PrependHitArray( // before. PopFrontHits guarantees that it will remove all 'i' hits so long // as there are at least 'i' hits in the posting list, which we know there // are. - PopFrontHits(posting_list_used, /*num_hits=*/i); + ICING_RETURN_IF_ERROR(PopFrontHits(posting_list_used, /*num_hits=*/i)); } return i; } |