File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed
Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -51,11 +51,9 @@ uint64 compress1(byte block[], uint length)
5151 delete cos;
5252 delete cis;
5353
54- if (memcmp (&buf[0 ], &block[0 ], length) != 0 )
55- return 3 ;
56-
54+ uint64 res = (memcmp (&buf[0 ], &block[0 ], length) != 0 ) ? 3 : read ^ written;
5755 delete[] buf;
58- return read ^ written ;
56+ return res ;
5957}
6058
6159uint64 compress2 (byte block[], uint length)
@@ -103,11 +101,9 @@ uint64 compress2(byte block[], uint length)
103101 delete cos;
104102 delete cis;
105103
106- if (memcmp (&buf[0 ], &block[0 ], length) != 0 )
107- return 3 ;
108-
104+ uint64 res = (memcmp (&buf[0 ], &block[0 ], length) != 0 ) ? 3 : read ^ written;
109105 delete[] buf;
110- return read ^ written ;
106+ return res ;
111107}
112108
113109uint64 compress3 (byte block[], uint length)
@@ -138,11 +134,9 @@ uint64 compress3(byte block[], uint length)
138134 delete cos;
139135 delete cis;
140136
141- if (memcmp (&buf[0 ], &block[0 ], length) != 0 )
142- return 3 ;
143-
137+ uint64 res = (memcmp (&buf[0 ], &block[0 ], length) != 0 ) ? 3 : read ^ written;
144138 delete[] buf;
145- return read ^ written ;
139+ return res ;
146140}
147141
148142uint64 compress4 (byte block[], uint length)
You can’t perform that action at this time.
0 commit comments