From cd9fe9ec03a189132630225e5d4df044901f2e23 Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Sun, 13 Oct 2024 11:10:10 +0000 Subject: [PATCH] refactor(codegen): rename vars in `CodeBuffer` methods (#6506) Pure refactor. Consistently use `byte` for bytes, and `ch` for `char`s. --- crates/oxc_codegen/src/code_buffer.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/oxc_codegen/src/code_buffer.rs b/crates/oxc_codegen/src/code_buffer.rs index fec738c5b059a..4581caf4877ee 100644 --- a/crates/oxc_codegen/src/code_buffer.rs +++ b/crates/oxc_codegen/src/code_buffer.rs @@ -139,7 +139,7 @@ impl CodeBuffer { /// Push a single ASCII byte into the buffer. /// /// # Panics - /// If `b` is not an ASCII byte (`0 - 0x7F`). + /// If `byte` is not an ASCII byte (`0 - 0x7F`). /// /// # Example /// ``` @@ -153,12 +153,12 @@ impl CodeBuffer { /// assert_eq!(source, "foo"); /// ``` #[inline] - pub fn print_ascii_byte(&mut self, b: u8) { + pub fn print_ascii_byte(&mut self, byte: u8) { // NOTE: since this method is inlined, this assertion should get - // optimized away by the compiler when the value of `b` is known, + // optimized away by the compiler when the value of `byte` is known, // e.g. when printing a constant. - assert!(b.is_ascii(), "byte {b} is not ASCII"); - self.buf.push(b); + assert!(byte.is_ascii(), "byte {byte} is not ASCII"); + self.buf.push(byte); } /// Push a byte to the buffer, without checking that the buffer still represents a valid @@ -201,8 +201,8 @@ impl CodeBuffer { /// [`take_source_text`]: CodeBuffer::take_source_text /// [`print_unchecked`]: CodeBuffer::print_unchecked #[inline] - pub unsafe fn print_byte_unchecked(&mut self, ch: u8) { - self.buf.push(ch); + pub unsafe fn print_byte_unchecked(&mut self, byte: u8) { + self.buf.push(byte); } /// Push a single Unicode character into the buffer.