From e6d91aafa1ad21339d741de6f50f1f21dd9e53f1 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Sun, 6 Jan 2019 16:05:23 -0500 Subject: Use req.fieldmap --- image.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/image.c b/image.c index a55c3a0..0198791 100644 --- a/image.c +++ b/image.c @@ -195,14 +195,11 @@ static void worker(void) { uint32_t tileX = TileInitX; uint32_t tileY = TileInitY; - - for (size_t i = 0; i < req.fieldsz; ++i) { - if (req.fields[i].state != KPAIR_VALID) continue; - if (req.fields[i].keypos == KeyX) { - tileX = (uint32_t)req.fields[i].parsed.i % TileCols; - } else if (req.fields[i].keypos == KeyY) { - tileY = (uint32_t)req.fields[i].parsed.i % TileRows; - } + if (req.fieldmap[KeyX]) { + tileX = (uint32_t)req.fieldmap[KeyX]->parsed.i % TileCols; + } + if (req.fieldmap[KeyY]) { + tileY = (uint32_t)req.fieldmap[KeyY]->parsed.i % TileRows; } error = khttp_head( -- cgit 1.4.1