diff options
| author | Aiden Fox Ivey <aiden@aidenfoxivey.com> | 2025-10-24 10:29:52 -0400 |
|---|---|---|
| committer | Takashi Kokubun <takashikkbn@gmail.com> | 2025-10-27 12:56:41 -0700 |
| commit | ac57a5c43ea6b12350eb7efbee50d6682021dc6c (patch) | |
| tree | 29de009631a3de7fd3face2ffdfda4634b29e8b5 | |
| parent | fa0eab2848f6ed73f34bf5d1d7e0fe6bf4e2f6e4 (diff) | |
ZJIT: Use .is_empty() for clarity
| -rw-r--r-- | zjit/src/cruby_methods.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/zjit/src/cruby_methods.rs b/zjit/src/cruby_methods.rs index 720683f407..9297327d73 100644 --- a/zjit/src/cruby_methods.rs +++ b/zjit/src/cruby_methods.rs @@ -237,7 +237,7 @@ fn no_inline(_fun: &mut hir::Function, _block: hir::BlockId, _recv: hir::InsnId, } fn inline_string_to_s(fun: &mut hir::Function, block: hir::BlockId, recv: hir::InsnId, args: &[hir::InsnId], state: hir::InsnId) -> Option<hir::InsnId> { - if args.len() == 0 && fun.likely_a(recv, types::StringExact, state) { + if args.is_empty() && fun.likely_a(recv, types::StringExact, state) { let recv = fun.coerce_to(block, recv, types::StringExact, state); return Some(recv); } @@ -245,7 +245,7 @@ fn inline_string_to_s(fun: &mut hir::Function, block: hir::BlockId, recv: hir::I } fn inline_kernel_itself(_fun: &mut hir::Function, _block: hir::BlockId, recv: hir::InsnId, args: &[hir::InsnId], _state: hir::InsnId) -> Option<hir::InsnId> { - if args.len() == 0 { + if args.is_empty() { // No need to coerce the receiver; that is done by the SendWithoutBlock rewriting. return Some(recv); } |
