Skip to content

Commit 3e8ad53

Browse files
committed
Cleanup the check_null function.
1 parent 80014b2 commit 3e8ad53

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2671,12 +2671,7 @@ fn exported_name(ccx: &CrateContext, id: ast::NodeId,
26712671
}
26722672

26732673
fn contains_null(s: &str) -> bool {
2674-
for b in s.bytes() {
2675-
if b == 0 {
2676-
return true
2677-
}
2678-
}
2679-
false
2674+
s.bytes().any(|b| b == 0)
26802675
}
26812676

26822677
pub fn get_item_val(ccx: &CrateContext, id: ast::NodeId) -> ValueRef {

0 commit comments

Comments
 (0)