Skip to content

Commit

Permalink
Remove unnecessary error check
Browse files Browse the repository at this point in the history
  • Loading branch information
islamaliev committed Mar 22, 2024
1 parent bb685f0 commit 5706485
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
5 changes: 0 additions & 5 deletions core/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,6 @@ func DecodeIndexDataStoreKey(
if err != nil {
return IndexDataStoreKey{}, err
}
if i == len(indexDesc.Fields) {
if _, ok := val.String(); !ok {
return IndexDataStoreKey{}, NewErrInvalidFieldValue("docID is not a string")
}
}

key.Fields = append(key.Fields, IndexedField{Value: val, Descending: descending})
}
Expand Down
5 changes: 0 additions & 5 deletions core/key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,6 @@ func TestDecodeIndexDataStoreKey_InvalidKey(t *testing.T) {
val: encodeKey(colID, indexID, 5, false, 7, false, 9, false),
numFields: 2,
},
{
name: "invalid docID value",
val: encoding.EncodeUvarintAscending(append(encodeKey(colID, indexID, 5, false), '/'), 5),
numFields: 1,
},
}
indexDesc := client.IndexDescription{ID: indexID, Fields: []client.IndexedFieldDescription{{}}}
for _, c := range cases {
Expand Down

0 comments on commit 5706485

Please sign in to comment.