Skip to content

Commit ebeec6e

Browse files
committed
feat: update ToLowerBytes and ToUpperBytes to use unsafe variants for in-place conversion
1 parent bb2fc8c commit ebeec6e

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

bytes.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ import (
88
casebytes "github.com/gofiber/utils/v2/bytes"
99
)
1010

11-
// ToLowerBytes converts an ASCII byte slice to lower-case without modifying the input.
11+
// ToLowerBytes converts an ASCII byte slice to lower-case in-place.
1212
//
13-
// Deprecated: use package "github.com/gofiber/utils/v2/bytes" and call bytes.ToLower.
14-
// This wrapper keeps backward compatibility by applying in-place conversion on a copied slice.
13+
// Deprecated: use package "github.com/gofiber/utils/v2/bytes" and call bytes.UnsafeToLower.
14+
// This wrapper keeps backward compatibility by mutating the provided slice.
1515
func ToLowerBytes(b []byte) []byte {
16-
return casebytes.ToLower(b)
16+
return casebytes.UnsafeToLower(b)
1717
}
1818

19-
// ToUpperBytes converts an ASCII byte slice to upper-case without modifying the input.
19+
// ToUpperBytes converts an ASCII byte slice to upper-case in-place.
2020
//
21-
// Deprecated: use package "github.com/gofiber/utils/v2/bytes" and call bytes.ToUpper.
22-
// This wrapper keeps backward compatibility by applying in-place conversion on a copied slice.
21+
// Deprecated: use package "github.com/gofiber/utils/v2/bytes" and call bytes.UnsafeToUpper.
22+
// This wrapper keeps backward compatibility by mutating the provided slice.
2323
func ToUpperBytes(b []byte) []byte {
24-
return casebytes.ToUpper(b)
24+
return casebytes.UnsafeToUpper(b)
2525
}
2626

2727
// AddTrailingSlashBytes appends a trailing '/' to b if it does not already end with one.

0 commit comments

Comments
 (0)