integer-sorting/radix-sort Home Manual Reference Source

src/array/core/load.js

  1. import assert from 'assert';
  2.  
  3. const load = (s, tuples, i, j, buffer) => {
  4. assert(buffer.length >= j - i);
  5. for (let pt = 0; i < j; ++i) {
  6. const tuple = tuples[i];
  7. assert(s >= 0 && s < tuple.length);
  8. // Assert(0 <= tuple[s] && tuple[s] < M);
  9. buffer[pt++] = tuple[s];
  10. }
  11. };
  12.  
  13. export default load;