mirror of https://github.com/mongodb/mongo
SERVER-90594 Add `bugprone-too-small-loop-variable` to clang-tidy (#22286)
GitOrigin-RevId: cf54d27c154af8d269c2f9159466d1ffb6b67e91
This commit is contained in:
parent
e8e0c79927
commit
56e5510928
|
|
@ -24,6 +24,7 @@ Checks: '-*,
|
|||
bugprone-suspicious-string-compare,
|
||||
bugprone-swapped-arguments,
|
||||
bugprone-terminating-continue,
|
||||
bugprone-too-small-loop-variable,
|
||||
bugprone-undelegated-constructor,
|
||||
bugprone-unused-raii,
|
||||
bugprone-unused-return-value,
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ public:
|
|||
}
|
||||
|
||||
static uint64_t deltaDouble(BSONElement val, BSONElement prev, double scaleFactor) {
|
||||
uint8_t scaleIndex = 0;
|
||||
size_t scaleIndex = 0;
|
||||
for (; scaleIndex < Simple8bTypeUtil::kScaleMultiplier.size(); ++scaleIndex) {
|
||||
if (Simple8bTypeUtil::kScaleMultiplier[scaleIndex] == scaleFactor)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ boost::optional<uint8_t> Simple8bTypeUtil::calculateDecimalShiftMultiplier(doubl
|
|||
}
|
||||
// Try multiplying by selected powers of 10 until we do not have any decimal digits. If we
|
||||
// always have leftover digits, return none.
|
||||
for (uint8_t i = 0; i < kScaleMultiplier.size(); ++i) {
|
||||
for (size_t i = 0; i < kScaleMultiplier.size(); ++i) {
|
||||
double scaleMultiplier = kScaleMultiplier[i];
|
||||
double valTimesMultiplier = val * scaleMultiplier;
|
||||
// Checks for both overflows
|
||||
|
|
|
|||
|
|
@ -329,7 +329,7 @@ StringData FieldRef::dottedSubstring(FieldIndex startPart, FieldIndex endPart) c
|
|||
bool FieldRef::equalsDottedField(StringData other) const {
|
||||
StringData rest = other;
|
||||
|
||||
for (FieldIndex i = 0; i < _parts.size(); i++) {
|
||||
for (size_t i = 0; i < _parts.size(); i++) {
|
||||
StringData part = getPart(i);
|
||||
|
||||
if (!rest.startsWith(part))
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ void applyChild(const UpdateNode& child,
|
|||
// If the child is an internal node, it may have created 'pathToCreate' and moved 'pathToCreate'
|
||||
// to the end of 'pathTaken'. We should advance 'element' to the end of 'pathTaken'.
|
||||
if (updateNodeApplyParams->pathTaken->size() > pathTakenSizeBefore) {
|
||||
for (auto i = pathTakenSizeBefore; i < updateNodeApplyParams->pathTaken->size(); ++i) {
|
||||
for (size_t i = pathTakenSizeBefore; i < updateNodeApplyParams->pathTaken->size(); ++i) {
|
||||
applyParams->element = getChild(
|
||||
applyParams->element, updateNodeApplyParams->pathTaken->fieldRef().getPart(i));
|
||||
invariant(applyParams->element.ok());
|
||||
|
|
|
|||
Loading…
Reference in New Issue