Skip to content

Commit

Permalink
Merge pull request #1089 from qtxie/issue-1088
Browse files Browse the repository at this point in the history
FIX: issue #1088 (select skip on hash returns none)
  • Loading branch information
dockimbel committed Apr 7, 2015
2 parents c4aa141 + 7bf5084 commit 4ef68a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions runtime/datatypes/block.reds
Original file line number Diff line number Diff line change
Expand Up @@ -1014,11 +1014,10 @@ block: context [
result/header: TYPE_NONE ;-- change the stack 1st argument to none.
]
][
key: _hashtable/get table value hash/head case? last? reverse?
key: _hashtable/get table value hash/head step case? last? reverse?
either any [
key = null
all [part? key > part]
all [step > 1 (as-integer s/offset + blk/head - key) >> 4 % step <> 0]
][
result/header: TYPE_NONE
][
Expand Down
2 changes: 2 additions & 0 deletions runtime/hashtable.reds
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ _hashtable: context [
node [node!]
key [red-value!]
head [integer!]
skip [integer!]
case? [logic!]
last? [logic!]
reverse? [logic!]
Expand Down Expand Up @@ -509,6 +510,7 @@ _hashtable: context [
_BUCKET_IS_NOT_DEL(flags ii sh)
TYPE_OF(k) = TYPE_OF(key)
actions/compare blk + idx key op
idx - head % skip = 0
][
either reverse? [
if all [idx < head idx > last-idx][last-idx: idx find?: yes]
Expand Down

0 comments on commit 4ef68a1

Please sign in to comment.