mirror of
https://github.com/github/codeql.git
synced 2026-04-27 01:35:13 +02:00
Swift: add comment about unique in getImmediateParent
This commit is contained in:
@@ -41,5 +41,7 @@ Element getAnImmediateChild(Element e) {
|
||||
* if `e` has conversions, `getImmediateParent(e)` will give the bottom conversion in the hidden AST.
|
||||
*/
|
||||
Element getImmediateParent(Element e) {
|
||||
// `unique` is used here to tell the optimizer that there is in fact only one result
|
||||
// this is tested by the `library-tests/parent/no_double_parents.ql` test
|
||||
result = unique(Element x | e = getAnImmediateChild(x) | x)
|
||||
}
|
||||
|
||||
@@ -238,5 +238,7 @@ Element getAnImmediateChild(Element e) {
|
||||
* if `e` has conversions, `getImmediateParent(e)` will give the bottom conversion in the hidden AST.
|
||||
*/
|
||||
Element getImmediateParent(Element e) {
|
||||
// `unique` is used here to tell the optimizer that there is in fact only one result
|
||||
// this is tested by the `library-tests/parent/no_double_parents.ql` test
|
||||
result = unique(Element x | e = getAnImmediateChild(x) | x)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user