diff options
Diffstat (limited to 'compare.go')
-rw-r--r-- | compare.go | 15 |
1 files changed, 1 insertions, 14 deletions
@@ -21,15 +21,6 @@ import ( "fmt" "io" "io/ioutil" - "regexp" -) - -var ( - // 00000230 44 46 20 31 2e 37 29 0a 2f 43 72 65 61 74 69 6f |DF 1.7)./Creatio| - // 00000240 6e 44 61 74 65 20 28 44 3a 32 30 31 35 31 30 30 |nDate (D:2015100| - // 00000250 38 31 32 33 30 34 35 29 0a 3e 3e 0a 65 6e 64 6f |8123045).>>.endo| - creationDateRe = regexp.MustCompile("/CreationDate \\(D:\\d{14}\\)") - fixDate = []byte("/CreationDate (D:20000101000000)") ) func writeBytes(leadStr string, startPos int, sl []byte) { @@ -71,15 +62,11 @@ func checkBytes(pos int, sl1, sl2 []byte) (eq bool) { } // compareBytes compares the bytes referred to by sl1 with those referred to by -// sl2. The comparison is done byte-for-byte with the exception of the -// CreationDate fields which are effectively ignored. Nil is returned if the -// buffers are equal, otherwise an error. +// sl2. Nil is returned if the buffers are equal, otherwise an error. func compareBytes(sl1, sl2 []byte) (err error) { var posStart, posEnd, len1, len2, length int var diffs bool - sl1 = creationDateRe.ReplaceAll(sl1, fixDate) - sl2 = creationDateRe.ReplaceAll(sl2, fixDate) len1 = len(sl1) len2 = len(sl2) length = len1 |