MCPcopy
hub / github.com/caddyserver/caddy / reverse

Function reverse

modules/caddyhttp/rewrite/rewrite.go:443–449  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

441}
442
443func reverse(s string) string {
444 r := []rune(s)
445 for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
446 r[i], r[j] = r[j], r[i]
447 }
448 return string(r)
449}
450
451// substrReplacer describes either a simple and fast substring replacement.
452type substrReplacer struct {

Callers 1

RewriteMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected