File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -180,13 +180,13 @@ StringRef sys::detail::getHostCPUNameForARM(StringRef ProcCpuinfoContent) {
180
180
StringRef Implementer;
181
181
StringRef Hardware;
182
182
StringRef Part;
183
- for (unsigned I = 0 , E = Lines. size (); I != E; ++I ) {
184
- if (Lines[I]. starts_with (" CPU implementer" ))
185
- Implementer = Lines[I]. substr ( 15 ) .ltrim (" \t :" );
186
- if (Lines[I]. starts_with (" Hardware" ))
187
- Hardware = Lines[I]. substr ( 8 ) .ltrim (" \t :" );
188
- if (Lines[I]. starts_with (" CPU part" ))
189
- Part = Lines[I]. substr ( 8 ) .ltrim (" \t :" );
183
+ for (StringRef Line : Lines) {
184
+ if (Line. consume_front (" CPU implementer" ))
185
+ Implementer = Line .ltrim (" \t :" );
186
+ else if (Line. consume_front (" Hardware" ))
187
+ Hardware = Line .ltrim (" \t :" );
188
+ else if (Line. consume_front (" CPU part" ))
189
+ Part = Line .ltrim (" \t :" );
190
190
}
191
191
192
192
if (Implementer == " 0x41" ) { // ARM Ltd.
You can’t perform that action at this time.
0 commit comments