remove test and try expressions in favor of if expressions

See #357
This commit is contained in:
Andrew Kelley
2017-05-03 17:23:11 -04:00
parent 0940d46c01
commit 644ea2dde9
19 changed files with 148 additions and 226 deletions

View File

@@ -28,7 +28,7 @@ pub const BufMap = struct {
}
pub fn set(self: &BufMap, key: []const u8, value: []const u8) -> %void {
test (self.hash_map.get(key)) |entry| {
if (self.hash_map.get(key)) |entry| {
const value_copy = %return self.copy(value);
%defer self.free(value_copy);
_ = %return self.hash_map.put(key, value_copy);