Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: service/datastore/properties.go

Issue 1302813003: impl/memory: Implement Queries (Closed) Base URL: https://github.com/luci/gae.git@add_multi_iterator
Patch Set: inequalities work now Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: service/datastore/properties.go
diff --git a/service/datastore/properties.go b/service/datastore/properties.go
index 63156fe68da97b5f7ddf9f4c4600aa2c53861d49..672fdbabac68d37f90a2c18a84cf70c2cf6291f2 100644
--- a/service/datastore/properties.go
+++ b/service/datastore/properties.go
@@ -112,7 +112,7 @@ type PropertyType byte
// https://cloud.google.com/appengine/docs/go/datastore/entities#Go_Value_type_ordering
// with a slight divergence for the Int/Time split.
// NOTE: this enum can only occupy 7 bits, because we use the high bit to encode
-// indexed/non-indexed. See typData.WriteBinary.
+// indexed/non-indexed. See serialize.WriteProperty.
const (
PTNull PropertyType = iota
PTInt
@@ -146,9 +146,19 @@ const (
PTKey
PTBlobKey
+ // NOTE: THIS MUST BE LAST VALUE FOR THE init() ASSERTION BELOW TO WORK.
PTUnknown
)
+func init() {
+ if PTUnknown > 0x7f {
dnj (Google) 2015/08/23 06:50:07 IMO put this check in "serialize", as it owns the
iannucci 2015/08/23 18:19:43 It's better here. There are actually 2 modules tha
+ panic(
+ "PTUnknown (and therefore PropertyType) exceeds 0x7f. This conflicts " +
+ "with serialize.WriteProperty's use of the high bit to indicate " +
+ "NoIndex.")
+ }
+}
+
func (t PropertyType) String() string {
switch t {
case PTNull:

Powered by Google App Engine
This is Rietveld 408576698