fix capturedb bug

This commit is contained in:
andri lim 2018-12-27 09:47:34 +07:00 committed by zah
parent 7683f68c15
commit 0487720769

View File

@ -17,7 +17,8 @@ proc get*(db: CaptureDB, key: openArray[byte]): seq[byte] =
result = db.dstDb.get(key) result = db.dstDb.get(key)
if result.len != 0: return if result.len != 0: return
result = db.srcDb.get(key) result = db.srcDb.get(key)
db.dstDb.put(key, result) if result.len == 0:
db.dstDb.put(key, result)
proc put*(db: CaptureDB, key, value: openArray[byte]) = proc put*(db: CaptureDB, key, value: openArray[byte]) =
db.dstDb.put(key, value) db.dstDb.put(key, value)