[lld] r228106 - Early return. NFC.
Rui Ueyama
ruiu at google.com
Tue Feb 3 18:01:04 PST 2015
Author: ruiu
Date: Tue Feb 3 20:01:04 2015
New Revision: 228106
URL: http://llvm.org/viewvc/llvm-project?rev=228106&view=rev
Log:
Early return. NFC.
Modified:
lld/trunk/lib/ReaderWriter/LinkerScript.cpp
Modified: lld/trunk/lib/ReaderWriter/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/LinkerScript.cpp?rev=228106&r1=228105&r2=228106&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/LinkerScript.cpp (original)
+++ lld/trunk/lib/ReaderWriter/LinkerScript.cpp Tue Feb 3 20:01:04 2015
@@ -505,23 +505,22 @@ void Lexer::skipWhitespace() {
break;
// Potential comment.
case '/':
- if (_buffer.size() >= 2 && _buffer[1] == '*') {
- // Skip starting /*
- _buffer = _buffer.drop_front(2);
- // If the next char is also a /, it's not the end.
- if (!_buffer.empty() && _buffer[0] == '/')
- _buffer = _buffer.drop_front();
-
- // Scan for /'s. We're done if it is preceded by a *.
- while (true) {
- if (_buffer.empty())
- break;
- _buffer = _buffer.drop_front();
- if (_buffer.data()[-1] == '/' && _buffer.data()[-2] == '*')
- break;
- }
- } else
+ if (_buffer.size() <= 1 || _buffer[1] != '*')
return;
+ // Skip starting /*
+ _buffer = _buffer.drop_front(2);
+ // If the next char is also a /, it's not the end.
+ if (!_buffer.empty() && _buffer[0] == '/')
+ _buffer = _buffer.drop_front();
+
+ // Scan for /'s. We're done if it is preceded by a *.
+ while (true) {
+ if (_buffer.empty())
+ break;
+ _buffer = _buffer.drop_front();
+ if (_buffer.data()[-1] == '/' && _buffer.data()[-2] == '*')
+ break;
+ }
break;
default:
return;
More information about the llvm-commits
mailing list