remove explicit comptime because of miscompilation
This commit is contained in:
21
src/root.zig
21
src/root.zig
@@ -71,19 +71,18 @@ fn intersect(comptime as: []const @Type(.enum_literal), comptime bs: []const @Ty
|
|||||||
/// Checks whether the log is enabled for a specific combination of `tags`. Depends on the `options`
|
/// Checks whether the log is enabled for a specific combination of `tags`. Depends on the `options`
|
||||||
/// set.
|
/// set.
|
||||||
pub fn logEnabled(comptime tags: []const @Type(.enum_literal)) bool {
|
pub fn logEnabled(comptime tags: []const @Type(.enum_literal)) bool {
|
||||||
comptime {
|
// If `tags` has at least one in `options.tags_disabled` then we never log.
|
||||||
// If `tags` has at least one in `options.tags_disabled` then we never log.
|
if (options.tags_disabled.len > 0) {
|
||||||
if (options.tags_disabled.len > 0) {
|
if (intersect(tags, options.tags_disabled)) {
|
||||||
if (intersect(tags, options.tags_disabled)) {
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If `tags` has at least one in `options.tags_enabled` then we should log.
|
|
||||||
if (options.tags_enabled.len > 0) {
|
|
||||||
return intersect(tags, options.tags_enabled);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If `tags` has at least one in `options.tags_enabled` then we should log.
|
||||||
|
if (options.tags_enabled.len > 0) {
|
||||||
|
return intersect(tags, options.tags_enabled);
|
||||||
|
}
|
||||||
|
|
||||||
// If neither is set then we just log everything.
|
// If neither is set then we just log everything.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user