How to use the sorted-array-functions.add function in sorted-array-functions

To help you get started, we’ve selected a few sorted-array-functions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-schedule / node-schedule / lib / schedule.js View on Github external
this.trackInvocation = function(invocation) {
    // add to our invocation list
    sorted.add(pendingInvocations, invocation, sorter);
    return true;
  };
  this.stopTrackingInvocation = function(invocation) {
github davidmarkclements / proffer / lib / load-symbols / index.js View on Github external
)

      // duplicates (names may differ slightly...)
      if (addrn in state.code && state.code[addrn].name.length >= name.length) {
        next()
        return
      }

      state.code[addrn] = {
        name: name,
        lib: lib,
        start: '0x' + addrn.toString(16),
        type: 'CPP'
      }

      sorted.add(state.addresses, addrn)

      next()
    }), (err) => {
      lib[PROCESSED] = true
github davidmarkclements / proffer / lib / core-events / code-move.js View on Github external
const match = state.addresses[ix]
      addr = match - 1
      // code previously cleared:
      if (state.code[match] === undefined) {
        sorted.remove(state.addresses, match)
        continue
      }
      if (match + +state.code[match][SIZE] <= to) continue

      sorted.remove(state.addresses, match)
      state.code[match] = undefined
    }

    entry[START] = toAddr
    state.code[to] = entry
    sorted.add(state.addresses, to)

    cb()
  }
}
github sx1989827 / DOClever / node_modules / node-schedule / lib / schedule.js View on Github external
function scheduleInvocation(invocation) {
  sorted.add(invocations, invocation, sorter);
  prepareNextInvocation();
  var date = invocation.fireDate instanceof CronDate ? invocation.fireDate.toDate() : invocation.fireDate;
  invocation.job.emit('scheduled', date);
}
github ILIAS-eLearning / ILIAS / Modules / Chatroom / chat / node_modules / node-schedule / lib / schedule.js View on Github external
function scheduleInvocation(invocation) {
  sorted.add(invocations, invocation, sorter);
  prepareNextInvocation();
  var date = invocation.fireDate instanceof CronDate ? invocation.fireDate.toDate() : invocation.fireDate;
  invocation.job.emit('scheduled', date);
}
github juliangruber / bisect-sorted-set / index.js View on Github external
Set.prototype.put = function (idx, value) {
  sorted.add(this._list, new Entry(idx, value), cmp)
}
github mmckegg / patchwork-next / modules / feed / pull / summary.js View on Github external
Object.keys(subscribes).forEach((key) => {
      if (subscribes[key].updated) {
        SortedArray.add(result, subscribes[key], compareUpdated)
      }
    })
    Object.keys(messageUpdates).forEach((key) => {
github mmckegg / patchwork-next / modules / feed / pull / summary.js View on Github external
bumpIfNeeded(group, msg, bumpFilter)
          } else {
            group.likes.delete(msg.value.author)
            if (group.lastUpdateType === 'like' && !group.likes.size && !group.replies.length) {
              group.lastUpdateType = 'reply'
            }
          }
        }
      }
    } else {
      if (c.root || (c.type === 'git-update' && c.repo)) {
        const group = ensureMessage(c.root || c.repo, messageUpdates)
        group.fromTime = fromTime
        group.lastUpdateType = 'reply'
        group.repliesFrom.add(msg.value.author)
        SortedArray.add(group.replies, msg, compareUserTimestamp)
        group.channel = group.channel || msg.value.content.channel
        bumpIfNeeded(group, msg, bumpFilter)
      } else {
        const group = ensureMessage(msg.key, messageUpdates)
        group.fromTime = fromTime
        group.lastUpdateType = 'post'
        group.updated = msg.timestamp || msg.value.sequence
        group.author = msg.value.author
        group.channel = msg.value.content.channel
        group.message = msg
        group.boxed = typeof msg.value.content === 'string'
      }
    }
  }, () => {
    var result = []

sorted-array-functions

Maintain and search through a sorted array using some low level functions

MIT
Latest version published 4 years ago

Package Health Score

65 / 100
Full package analysis

Similar packages