diff options
Diffstat (limited to 'applap.go')
-rw-r--r-- | applap.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/applap.go b/applap.go new file mode 100644 index 0000000..efe7b6f --- /dev/null +++ b/applap.go @@ -0,0 +1,18 @@ +//go:build appengine + +package rabaead + +import "reflect" + +func anyOverlap(x, y []byte) bool { + return len(x) > 0 && len(y) > 0 && + reflect.ValueOf(&x[0]).Pointer() <= reflect.ValueOf(&y[len(y)-1]).Pointer() && + reflect.ValueOf(&y[0]).Pointer() <= reflect.ValueOf(&x[len(x)-1]).Pointer() +} + +func inexactOverlap(x, y []byte) bool { + if len(x) == 0 || len(y) == 0 || &x[0] == &y[0] { + return false + } + return anyOverlap(x, y) +} |