Skip to content

Commit 821de63

Browse files
authored
Python: Remove redundant inline casts
These are all implied by the return type of the other side of the equality.
1 parent 74f0bdf commit 821de63

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

python/ql/lib/semmle/python/frameworks/Django.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1873,7 +1873,7 @@ module PrivateDjango {
18731873
/** Gets a reference to this class. */
18741874
private DataFlow::TypeTrackingNode getARef(DataFlow::TypeTracker t) {
18751875
t.start() and
1876-
result.asExpr().(ClassExpr) = this.getParent()
1876+
result.asExpr() = this.getParent()
18771877
or
18781878
exists(DataFlow::TypeTracker t2 | result = this.getARef(t2).track(t2, t))
18791879
}

python/ql/lib/semmle/python/frameworks/Flask.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ module Flask {
193193

194194
FlaskViewClass() {
195195
this.getABase() = Views::View::subclassRef().getAUse().asExpr() and
196-
api_node.getAnImmediateUse().asExpr().(ClassExpr) = this.getParent()
196+
api_node.getAnImmediateUse().asExpr() = this.getParent()
197197
}
198198

199199
/** Gets a function that could handle incoming requests, if any. */
@@ -218,7 +218,7 @@ module Flask {
218218
class FlaskMethodViewClass extends FlaskViewClass {
219219
FlaskMethodViewClass() {
220220
this.getABase() = Views::MethodView::subclassRef().getAUse().asExpr() and
221-
api_node.getAnImmediateUse().asExpr().(ClassExpr) = this.getParent()
221+
api_node.getAnImmediateUse().asExpr() = this.getParent()
222222
}
223223

224224
override Function getARequestHandler() {
@@ -299,7 +299,7 @@ module Flask {
299299
override Function getARequestHandler() {
300300
exists(DataFlow::LocalSourceNode func_src |
301301
func_src.flowsTo(this.getViewArg()) and
302-
func_src.asExpr().(CallableExpr) = result.getDefinition()
302+
func_src.asExpr() = result.getDefinition()
303303
)
304304
or
305305
exists(FlaskViewClass vc |

python/ql/lib/semmle/python/frameworks/Tornado.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ private module Tornado {
102102
/** Gets a reference to this class. */
103103
private DataFlow::TypeTrackingNode getARef(DataFlow::TypeTracker t) {
104104
t.start() and
105-
result.asExpr().(ClassExpr) = this.getParent()
105+
result.asExpr() = this.getParent()
106106
or
107107
exists(DataFlow::TypeTracker t2 | result = this.getARef(t2).track(t2, t))
108108
}

0 commit comments

Comments
 (0)