mirror of
https://github.com/github/codeql.git
synced 2026-04-19 14:04:09 +02:00
Rust: improve performance of Crate::toString
This commit is contained in:
@@ -12,8 +12,18 @@ private import codeql.rust.elements.internal.generated.Crate
|
||||
*/
|
||||
module Impl {
|
||||
class Crate extends Generated::Crate {
|
||||
override string toString() {
|
||||
result = "Crate(" + this.getName() + "@" + concat(this.getVersion()) + ")"
|
||||
override string toString() { result = strictconcat(int i | | this.toStringPart(i) order by i) }
|
||||
|
||||
private string toStringPart(int i) {
|
||||
i = 0 and result = "Crate("
|
||||
or
|
||||
i = 1 and result = this.getName()
|
||||
or
|
||||
i = 2 and result = "@"
|
||||
or
|
||||
i = 3 and result = this.getVersion()
|
||||
or
|
||||
i = 4 and result = ")"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user