mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-22 06:48:56 +08:00
Add an assert that builtin names are sorted
This commit is contained in:
parent
96da62ea87
commit
0170875ece
@ -485,7 +485,10 @@ static const builtin_data_t *builtin_lookup(const wcstring &name) {
|
||||
/// Initialize builtin data.
|
||||
void builtin_init() {
|
||||
for (size_t i = 0; i < BUILTIN_COUNT; i++) {
|
||||
intern_static(builtin_datas[i].name);
|
||||
const wchar_t *name = builtin_datas[i].name;
|
||||
intern_static(name);
|
||||
assert((i == 0 || wcscmp(builtin_datas[i - 1].name, name) < 0) &&
|
||||
"builtins are not sorted alphabetically");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user