Skip to content

Commit

Permalink
spec.false should prevent indexing, but false was or'd with 1
Browse files Browse the repository at this point in the history
  • Loading branch information
silentbicycle committed Jan 20, 2012
1 parent 4dad454 commit 35425d2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tamale.lua
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 204,13 @@ local function index_spec(spec)

local debug = spec.debug
-- field/value to index by, defaults to t[1].
local ispec, indexer = spec.index or 1
local ispec, indexer
if spec.index == false then
ispec = false -- false -> don't index
else
ispec = spec.index or 1
end

if type(ispec) == "function" then indexer = ispec
elseif ispec == "false" then
indexer = function() end --put everything in the same index
Expand Down

0 comments on commit 35425d2

Please sign in to comment.