mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
Merge pull request #1433 from aeyerstaylor/faster-python
Python: Improve performance of submodule name computation.
This commit is contained in:
@@ -155,7 +155,12 @@ class PackageObjectInternal extends ModuleObjectInternal, TPackageObject {
|
||||
|
||||
/** Gets the submodule `name` of this package */
|
||||
ModuleObjectInternal submodule(string name) {
|
||||
result.getName() = this.getName() + "." + name
|
||||
exists(string fullName, int lastDotIndex |
|
||||
fullName = result.getName() and
|
||||
lastDotIndex = max(fullName.indexOf(".")) and
|
||||
name = fullName.substring(lastDotIndex + 1, fullName.length()) and
|
||||
this.getName() = fullName.substring(0, lastDotIndex)
|
||||
)
|
||||
}
|
||||
|
||||
override int intValue() {
|
||||
|
||||
Reference in New Issue
Block a user