Skip to content

Commit 80e29dc

Browse files
author
Dave Bartolomeo
committed
C++: Fix comment and remove unnecessary max()
1 parent 0219dbe commit 80e29dc

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

cpp/ql/src/semmle/code/cpp/ir/internal/CppType.qll

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ private int getTypeSizeWorkaround(Type type) {
3737
private int getTypeSize(Type type) {
3838
if exists(getTypeSizeWorkaround(type))
3939
then result = getTypeSizeWorkaround(type)
40-
else result = max(type.getSize())
40+
else result = type.getSize()
4141
}
4242

4343
/**
@@ -399,11 +399,8 @@ private int getSignPriority(IntegralType type) {
399399
* Gets the sort priority of an `IntegralType` based on its kind.
400400
*/
401401
private int getKindPriority(IntegralType type) {
402-
/*
403-
* `CharType` sorts lower so that we prefer the plain integer types when they have the same size as
404-
* a `CharType`.
405-
*/
406-
402+
// `CharType` sorts lower so that we prefer the plain integer types when they have the same size
403+
// as a `CharType`.
407404
if type instanceof CharType then result = 0 else result = 1
408405
}
409406

0 commit comments

Comments
 (0)