Explorar el Código

Add equals function to binary data

Billy Barrow hace 1 año
padre
commit
8f3d875b43
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      src/lib/Concrete/BinaryData.vala

+ 4 - 0
src/lib/Concrete/BinaryData.vala

@@ -142,6 +142,10 @@ namespace Invercargill {
             values.iterate(i => push_uint64(i));
         }
 
+        public bool equals(Enumerable<uint8> other) {
+            return this == other || matches(other, (a, b) => a == b);
+        }
+
         public void push_int32(int32 value) {
             var chunk = new uint8[sizeof(int32)];
             int32 val;