@@ -66,11 +66,11 @@ if c.table[j] == value { // Output the value buffer[index] = j // Shift the table - copy(c.table[1:j+1], c.table[0:j]) + copy(c.table[1:], c.table[:j]) // Restore the value in front and break c.table[0] = value break } @@ -113,11 +113,11 @@ // Output the value output[i] = c.table[position] // Shift the table and restore the value in front - copy(c.table[1:position+1], c.table[0:position]) + copy(c.table[1:], c.table[:position]) c.table[0] = output[i] } return count, err }