Reapply "feature: Adds semi-broken stability improvements into the runtime environment."
This reverts commit 157e1c8712
.
This commit is contained in:
parent
157e1c8712
commit
f24daabe45
3 changed files with 205 additions and 35 deletions
|
@ -67,16 +67,21 @@ type BackupData struct {
|
|||
}
|
||||
|
||||
// From https://stackoverflow.com/questions/54461423/efficient-way-to-remove-all-non-alphanumeric-characters-from-large-text
|
||||
// Strips all alphanumeric characters from a string
|
||||
func stripAllAlphanumeric(s string) string {
|
||||
var result strings.Builder
|
||||
|
||||
for i := 0; i < len(s); i++ {
|
||||
b := s[i]
|
||||
if ('a' <= b && b <= 'z') ||
|
||||
('A' <= b && b <= 'Z') ||
|
||||
('0' <= b && b <= '9') {
|
||||
result.WriteByte(b)
|
||||
} else {
|
||||
result.WriteByte('_')
|
||||
}
|
||||
}
|
||||
|
||||
return result.String()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue