Skip to content

Commit ad03074

Browse files
committed
[lld/mac] Make two local variables const
While reading this code, I was wondering if we change these variables in the loop. We don't, so make them const to make this easier to see next time. No behavior change. Differential Revision: https://reviews.llvm.org/D135877
1 parent b4c8c49 commit ad03074

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lld/MachO/InputFiles.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ void ObjFile::parseSymbols(ArrayRef<typename LP::section> sectionHeaders,
807807
// subsection here.
808808
if (sections[i]->doneSplitting) {
809809
for (size_t j = 0; j < symbolIndices.size(); ++j) {
810-
uint32_t symIndex = symbolIndices[j];
810+
const uint32_t symIndex = symbolIndices[j];
811811
const NList &sym = nList[symIndex];
812812
StringRef name = strtab + sym.n_strx;
813813
uint64_t symbolOffset = sym.n_value - sectionAddr;
@@ -833,7 +833,7 @@ void ObjFile::parseSymbols(ArrayRef<typename LP::section> sectionHeaders,
833833
return nList[lhs].n_value < nList[rhs].n_value;
834834
});
835835
for (size_t j = 0; j < symbolIndices.size(); ++j) {
836-
uint32_t symIndex = symbolIndices[j];
836+
const uint32_t symIndex = symbolIndices[j];
837837
const NList &sym = nList[symIndex];
838838
StringRef name = strtab + sym.n_strx;
839839
Subsection &subsec = subsections.back();

0 commit comments

Comments
 (0)