Skip to content

Commit e6ced1d

Browse files
committed
Feedback.
1 parent 27bc993 commit e6ced1d

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

Firestore/core/src/index/firestore_index_value_writer.cc

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
#include "Firestore/core/src/index/firestore_index_value_writer.h"
1718

1819
#include <cmath>
@@ -52,18 +53,6 @@ enum IndexType {
5253
kNotTruncated = 2
5354
};
5455

55-
// The write methods below short-circuit writing terminators for values
56-
// containing a (terminating) truncated value.
57-
//
58-
// As an example, consider the resulting encoding for:
59-
//
60-
// ["bar", [2, "foo"]] -> (STRING, "bar", TERM, ARRAY, NUMBER, 2, STRING, "foo",
61-
// TERM, TERM, TERM)
62-
// ["bar", [2, truncated("foo")]] -> (STRING, "bar", TERM, ARRAY, NUMBER, 2,
63-
// STRING, "foo", TRUNC)
64-
// ["bar", truncated(["foo"])] -> (STRING, "bar", TERM, ARRAY. STRING, "foo",
65-
// TERM, TRUNC)
66-
6756
void WriteValueTypeLabel(DirectionalIndexByteEncoder* encoder, int type_order) {
6857
encoder->WriteLong(type_order);
6958
}

Firestore/core/src/index/firestore_index_value_writer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
#ifndef FIRESTORE_CORE_SRC_INDEX_FIRESTORE_INDEX_VALUE_WRITER_H_
1718
#define FIRESTORE_CORE_SRC_INDEX_FIRESTORE_INDEX_VALUE_WRITER_H_
1819

Firestore/core/src/index/index_byte_encoder.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
#ifndef FIRESTORE_CORE_SRC_INDEX_INDEX_BYTE_ENCODER_H_
1718
#define FIRESTORE_CORE_SRC_INDEX_INDEX_BYTE_ENCODER_H_
1819

@@ -33,6 +34,8 @@ namespace index {
3334
/** An index value encoder. */
3435
class DirectionalIndexByteEncoder {
3536
public:
37+
virtual ~DirectionalIndexByteEncoder() = default;
38+
3639
virtual void WriteBytes(pb_bytes_array_t* val) = 0;
3740

3841
virtual void WriteString(absl::string_view val) = 0;
@@ -42,8 +45,6 @@ class DirectionalIndexByteEncoder {
4245
virtual void WriteDouble(double val) = 0;
4346

4447
virtual void WriteInfinity() = 0;
45-
46-
virtual ~DirectionalIndexByteEncoder() = default;
4748
};
4849

4950
class AscendingIndexByteEncoder;
@@ -86,6 +87,7 @@ class IndexEncodingBuffer {
8687
private:
8788
friend class AscendingIndexByteEncoder;
8889
friend class DescendingIndexByteEncoder;
90+
8991
std::string buffer_;
9092
std::unique_ptr<AscendingIndexByteEncoder> ascendingEncoder_;
9193
std::unique_ptr<DescendingIndexByteEncoder> descendingEncoder_;

0 commit comments

Comments
 (0)