mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 03:18:53 +00:00
CSS: More stuff and tests (#14832)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
This commit is contained in:
@@ -4397,7 +4397,7 @@ pub fn trimLeadingChar(slice: []const u8, char: u8) []const u8 {
|
||||
/// e.g.
|
||||
/// `trimLeadingPattern2("abcdef", 'a', 'b') == "cdef"`
|
||||
pub fn trimLeadingPattern2(slice_: []const u8, comptime byte1: u8, comptime byte2: u8) []const u8 {
|
||||
const pattern: u16 = comptime @as(u16, byte1) << 8 | @as(u16, byte2);
|
||||
const pattern: u16 = comptime @as(u16, byte2) << 8 | @as(u16, byte1);
|
||||
var slice = slice_;
|
||||
while (slice.len >= 2) {
|
||||
const sliceu16: [*]const u16 = @ptrCast(@alignCast(slice.ptr));
|
||||
|
||||
Reference in New Issue
Block a user