소스 검색

Add equals function to binary data

Billy Barrow 2 년 전
부모
커밋
8f3d875b43
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  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;