Skip to content

Commit 0f9c41a

Browse files
author
wangze
committed
fix sort issue
1 parent 0274f93 commit 0f9c41a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/TypeMetaClass.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ export class TypeMetaProperty{
1515
}
1616
}
1717

18-
function strcmp(a, b) {
19-
return (a < b? -1: (a > b? 1: 0));
18+
function sort(a:TypeMetaProperty, b:TypeMetaProperty) {
19+
return a.key.localeCompare(b.key);
2020
}
2121

2222
export class TypeMetaClass {
@@ -52,7 +52,7 @@ export class TypeMetaClass {
5252
public sortProperty() {
5353
if (!this.m_needSort)
5454
return;
55-
this.properties.sort((a, b) => strcmp(a, b));
55+
this.properties.sort((a, b) => sort(a, b));
5656
this.m_needSort = false;
5757
return this;
5858
}

0 commit comments

Comments
 (0)