mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-02 05:41:16 -03:00
Change extract_prefix_and_unescape_yaml() assert!() to debug_assert!()
It's reasonable since this is only checking to see that the history file contains the expected format and if it's corrupted but we at least got what we expect to be the correct key/value pairs, then that's all we can do. Of course the real motivation is to speed up this very hot function in any way possible!
This commit is contained in:
@@ -317,6 +317,7 @@ fn extract_prefix_and_unescape_yaml(line: &[u8]) -> Option<(Cow<[u8]>, Cow<[u8]>
|
||||
let mut split = line.splitn(2, |c| *c == b':');
|
||||
let key = split.next().unwrap();
|
||||
let value = split.next()?;
|
||||
debug_assert!(split.next().is_none());
|
||||
|
||||
let key: Cow<[u8]> = if key.iter().copied().any(|b| b == b'\\') {
|
||||
let mut key = key.to_owned();
|
||||
|
||||
Reference in New Issue
Block a user