From bbf80875fb6be49de54f94847d176caceac8822f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=81=AB=E7=84=9A=20=E5=AF=8C=E8=89=AF?= Date: Mon, 13 Mar 2023 18:18:26 +0800 Subject: [PATCH] firmware: assume empty config records as removed (#2064) This will return `KeyNotFound` for empty values, which are produced by `remove` operation Signed-off-by: Egor Savkin --- artiq/firmware/libboard_misoc/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artiq/firmware/libboard_misoc/config.rs b/artiq/firmware/libboard_misoc/config.rs index 51f71ac33..e5e62ad0c 100644 --- a/artiq/firmware/libboard_misoc/config.rs +++ b/artiq/firmware/libboard_misoc/config.rs @@ -163,7 +163,7 @@ mod imp { while let Some(result) = iter.next() { let (record_key, record_value) = result?; if key.as_bytes() == record_key { - found = true; + found = !record_value.is_empty(); // last write wins value = record_value }