Skip to content

Commit ac57a5c

Browse files
aidenfoxiveyk0kubun
authored andcommitted
ZJIT: Use .is_empty() for clarity
1 parent fa0eab2 commit ac57a5c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

zjit/src/cruby_methods.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,15 @@ fn no_inline(_fun: &mut hir::Function, _block: hir::BlockId, _recv: hir::InsnId,
237237
}
238238

239239
fn inline_string_to_s(fun: &mut hir::Function, block: hir::BlockId, recv: hir::InsnId, args: &[hir::InsnId], state: hir::InsnId) -> Option<hir::InsnId> {
240-
if args.len() == 0 && fun.likely_a(recv, types::StringExact, state) {
240+
if args.is_empty() && fun.likely_a(recv, types::StringExact, state) {
241241
let recv = fun.coerce_to(block, recv, types::StringExact, state);
242242
return Some(recv);
243243
}
244244
None
245245
}
246246

247247
fn inline_kernel_itself(_fun: &mut hir::Function, _block: hir::BlockId, recv: hir::InsnId, args: &[hir::InsnId], _state: hir::InsnId) -> Option<hir::InsnId> {
248-
if args.len() == 0 {
248+
if args.is_empty() {
249249
// No need to coerce the receiver; that is done by the SendWithoutBlock rewriting.
250250
return Some(recv);
251251
}

0 commit comments

Comments
 (0)