refactor cmpNimIdentifier (#16611)

* refactor cmpNimIdentifier

* Apply suggestions from code review

Co-authored-by: Clyybber <darkmine956@gmail.com>

Co-authored-by: Clyybber <darkmine956@gmail.com>
This commit is contained in:
flywind 2021-01-13 05:29:30 -06:00 • committed by GitHub
commit b727217229
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 9 deletions

View file

@ -70,3 +70,7 @@ template endsWithImpl*[T: string | cstring](s, suffix: T) =
if s[i+j] != suffix[i]: return false
inc(i)
if i >= suffixLen: return true
func cmpNimIdentifier*[T: string | cstring](a, b: T): int =
cmpIgnoreStyleImpl(a, b, true)