Skip to content

Commit

Permalink
Support lookup tables with one element, final fix of #322
Browse files Browse the repository at this point in the history
  • Loading branch information
kintel committed May 9, 2013
1 parent 3780677 commit e01b37a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/func.cc
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,7 @@ Value builtin_lookup(const Context *, const EvalContext *evalctx)
double p, low_p, low_v, high_p, high_v;
if (evalctx->numArgs() < 2 || // Needs two args
!evalctx->getArgValue(0).getDouble(p) || // First must be a number
evalctx->getArgValue(1).toVector().size() < 2 || // Second must be a vector of vectors
evalctx->getArgValue(1).toVector()[0].toVector().size() < 2)
evalctx->getArgValue(1).toVector()[0].toVector().size() < 2) // Second must be a vector of vectors
return Value();
if (!evalctx->getArgValue(1).toVector()[0].getVec2(low_p, low_v) || !evalctx->getArgValue(1).toVector()[0].getVec2(high_p, high_v))
return Value();
Expand Down

0 comments on commit e01b37a

Please sign in to comment.