summaryrefslogtreecommitdiff
path: root/viewstate.py
diff options
context:
space:
mode:
authorYuval Adam <yuval@y3xz.com>2016-03-24 22:24:43 +0200
committerYuval Adam <yuval@y3xz.com>2016-03-24 22:24:43 +0200
commitc4c6b4e7c17e5b96d86828a3bc809a1c6c9559df (patch)
tree2f3b37f5740f134619211e627fccadc441f78f10 /viewstate.py
parentf8ec6c5a397d884a039811aac8d64d2759fe0b6f (diff)
Extract parse_const
Diffstat (limited to 'viewstate.py')
-rw-r--r--viewstate.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/viewstate.py b/viewstate.py
index bf14005..b75cd37 100644
--- a/viewstate.py
+++ b/viewstate.py
@@ -9,10 +9,13 @@ CONSTS = {
104: False
}
+def parse_const(b):
+ return CONSTS.get(b, None)
+
def parse(b):
assert type(b) == bytes().__class__
- if len(b) == 1 and b[0] in CONSTS:
- return CONSTS[b[0]]
+ if len(b) == 1:
+ return parse_const(b[0])
return None