Fix setting prev/next refs on insert Obviously this needs to be the ref, not the `node` record.
Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/dc95df88 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/dc95df88 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/dc95df88 Branch: refs/heads/HACK-benchmark-COUCHDB-3191-improve-couch-lru-performance Commit: dc95df88c65094cd26c60a186cdd1c285451369a Parents: 39357ed Author: Paul J. Davis <paul.joseph.da...@gmail.com> Authored: Mon Oct 17 14:06:18 2016 -0500 Committer: Paul J. Davis <paul.joseph.da...@gmail.com> Committed: Mon Oct 17 14:06:18 2016 -0500 ---------------------------------------------------------------------- src/couch_lru.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/dc95df88/src/couch_lru.erl ---------------------------------------------------------------------- diff --git a/src/couch_lru.erl b/src/couch_lru.erl index 7f30513..dcb025f 100644 --- a/src/couch_lru.erl +++ b/src/couch_lru.erl @@ -71,9 +71,9 @@ insert(DbName, Lru) -> {undefined, undefined} -> {Ref, Ref}; {_, _} when is_reference(Head), is_reference(Tail) -> - set_next(Lru, Tail, Node), - set_prev(Lru, Node, Tail), - {Head, Node} + set_next(Lru, Tail, Ref), + set_prev(Lru, Ref, Tail), + {Head, Ref} end, Lru#lru{ head = NewHead,