Skip to content

Commit

Permalink
code optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
aiceflower committed Jan 2, 2025
1 parent def7d82 commit 415a209
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ abstract class PythonModuleLoad extends Logging {
.getModulesInfo()

// 使用Collections.sort()和Comparator进行排序
Collections.sort(
infoList,
new Comparator[PythonModuleInfoVO]() {
override def compare(o1: PythonModuleInfoVO, o2: PythonModuleInfoVO): Int =
Integer.compare(o1.getId.toInt, o1.getId.toInt)
}
)
if (infoList != null && !infoList.isEmpty) {
Collections.sort(
infoList,
new Comparator[PythonModuleInfoVO]() {
override def compare(o1: PythonModuleInfoVO, o2: PythonModuleInfoVO): Int =
Integer.compare(o1.getId.toInt, o1.getId.toInt)
}
)
}
infoList
}

Expand Down

0 comments on commit 415a209

Please sign in to comment.