Add a ~+ operator.

This commit is contained in:
Nigel Tao committed 2017-10-19 16:50:05 +11:00
1 parent e7d01e7b2a
commit 6492c52156
8 files changed
+154 -99

No files matched your search

+1 -2
View File
@@ -390,8 +390,7 @@ pri func decoder.decode_huffman?(dst writer1, src reader1)() {
}
if n_copied > 0 {
hlen -= n_copied
// TODO: a "~+" tilde-operator that ignores overflow.
hdist = (hdist + (n_copied & 0x7FFF)) & 0x7FFF
hdist = (hdist ~+ n_copied) & 0x7FFF
if hdist == 0 {
// Wrap around the this.history ringbuffer.
break