Function allEqual [src]
Returns true if all elements in a slice are equal to the scalar value provided
Prototype
pub fn allEqual(comptime T: type, slice: []const T, scalar: T) bool
Parameters
T: type
slice: []const T
scalar: T
Source
pub fn allEqual(comptime T: type, slice: []const T, scalar: T) bool {
for (slice) |item| {
if (item != scalar) return false;
}
return true;
}