Skip to content

Commit

Permalink
Remove defunct commit helper utility.
Browse files Browse the repository at this point in the history
Closes #501.
  • Loading branch information
flatheadmill committed Mar 1, 2015
1 parent 1fed933 commit 3a43238
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 33 deletions.
28 changes: 0 additions & 28 deletions commit.sh

This file was deleted.

12 changes: 9 additions & 3 deletions cursor.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ Cursor.prototype.next = cadence(function (async) {
// to user land
Cursor.prototype.indexOf = function (key, index) {
ok(arguments.length == 2, 'index requires two arguments')
ok(index === 0 || index === 1, 'unexpected index')
var page = this._page
var index = this._sheaf.find(page, key, index)
var index = this._sheaf.find(page, key, 0)
var unambiguous
unambiguous = -1 < index // <- todo: ?
|| ~ index < this._page.items.length
Expand Down Expand Up @@ -103,7 +104,7 @@ Cursor.prototype._filename = function (page) {

Cursor.prototype.insert = function (record, key, index) {
ok(this.exclusive, 'cursor is not exclusive')
ok(index > 0 || this._page.address == 1)
ok(index > 0 || this._page.address == 1 || this._page.ghosts === 1, 'insert at ghost')

this._sheaf.unbalanced(this._page)

Expand All @@ -112,8 +113,13 @@ Cursor.prototype.insert = function (record, key, index) {
}

var heft = this._appender.writeInsert(index, record).heft
var replace = 0
if (index === 0) {
this._page.ghosts--
replace = 1
}

this._page.splice(index, 0, {
this._page.splice(index, replace, {
key: key,
record: record,
heft: heft
Expand Down
1 change: 1 addition & 0 deletions release.ft
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The common utility functions are now exported globally. They may move into a uti

### Issue by Issue

* Remove defunct commit helper utility. #501.
* Upgrade Advance and Splice. #498.
* Upgrade Cadence to 0.0.52. #497.
* User record serializer in `writeInsert`. #495.
Expand Down
5 changes: 3 additions & 2 deletions t/proof.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,14 @@ function abstracted (dir) {
b = b.name.split('.').pop()
return +(a) - +(b)
})
// console.log(files.map(function (file) { return file.name }))
console.log(files.map(function (file) { return file.name }))
record = { log: [] }
var entry = 0
files.forEach(function (file) {
position = 0
console.log(file)
file.body.forEach(function (line, index) {
// console.log(line)
console.log(line)
var json = line.header
ok(++entry == json[0], 'entry record is wrong')
if (json[1]) {
Expand Down

0 comments on commit 3a43238

Please sign in to comment.