aboutsummaryrefslogtreecommitdiff
path: root/src/sourcemap/sourcemap.zig
diff options
context:
space:
mode:
authorGravatar Alex Lam S.L <alexlamsl@gmail.com> 2023-01-10 15:35:20 +0200
committerGravatar GitHub <noreply@github.com> 2023-01-10 05:35:20 -0800
commit270b07e85e82b46491cc713fb2a5bb973d3de4f6 (patch)
treeb8071eaf835f2aefb8ee95c68f9002d84b7b5761 /src/sourcemap/sourcemap.zig
parentb458abedbb865461005757cac5ea2b458249ef25 (diff)
downloadbun-270b07e85e82b46491cc713fb2a5bb973d3de4f6.tar.gz
bun-270b07e85e82b46491cc713fb2a5bb973d3de4f6.tar.zst
bun-270b07e85e82b46491cc713fb2a5bb973d3de4f6.zip
use `strings.hasPrefixComptime()` (#1755)
Diffstat (limited to 'src/sourcemap/sourcemap.zig')
-rw-r--r--src/sourcemap/sourcemap.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sourcemap/sourcemap.zig b/src/sourcemap/sourcemap.zig
index 58c781762..592df5d1d 100644
--- a/src/sourcemap/sourcemap.zig
+++ b/src/sourcemap/sourcemap.zig
@@ -118,8 +118,8 @@ pub const Mapping = struct {
if (remain[0] == ';') {
generated.columns = 0;
- while (remain.len > @sizeOf(usize) / 2 and strings.eqlComptimeIgnoreLen(
- remain[0 .. @sizeOf(usize) / 2],
+ while (strings.hasPrefixComptime(
+ remain,
comptime [_]u8{';'} ** (@sizeOf(usize) / 2),
)) {
generated.lines += (@sizeOf(usize) / 2);
@@ -210,7 +210,7 @@ pub const Mapping = struct {
remain = remain[source_index_delta.start..];
// // "AAAA" is extremely common
- // if (remain.len > 5 and remain[4] == ';' and strings.eqlComptimeIgnoreLen(remain[0..4], "AAAA")) {
+ // if (strings.hasPrefixComptime(remain, "AAAA;")) {
// }