Skip to content

Commit 0b59317

Browse files
committed
A27-0-3: Improve performance
oppositeDirection was a performance problem, because it was not restricted to read write calls with the same source.
1 parent 3720495 commit 0b59317

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- `A27-0-3`, `FIO309-C` `FIO50-CPP`, `RULE-30-0-2` - `InterleavedInputOutputWithoutFlush.ql`, `DoNotAlternatelyIOFromStreamWithoutPositioning.ql`,`InterleavedInputOutputWithoutPosition.ql`, `ReadsAndWritesOnStreamNotSeparatedByPositioning.ql`:
2+
- Reduce evaluation time on complex codebases.

cpp/common/src/codingstandards/cpp/rules/iofstreammissingpositioning/IOFstreamMissingPositioning.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,19 @@ predicate sameSource(FunctionCall a, FunctionCall b) {
5757
sameFileSource(a, b)
5858
}
5959

60+
bindingset[a, b]
6061
predicate sameAccessDirection(ReadWriteCall a, ReadWriteCall b) {
6162
a.getAccessDirection() = b.getAccessDirection()
6263
}
6364

65+
bindingset[a, b]
6466
predicate oppositeAccessDirection(ReadWriteCall a, ReadWriteCall b) {
6567
not sameAccessDirection(a, b)
6668
}
6769

6870
/**
6971
* A write operation reaching a read and vice versa
70-
* without intervening filepositioning
72+
* without intervening file positioning calls.
7173
*/
7274
ControlFlowNode reachesInExOperator(ReadWriteCall op) {
7375
result = op

0 commit comments

Comments
 (0)