From: Rui Ueyama Date: Wed, 4 Feb 2015 02:01:04 +0000 (+0000) Subject: Early return. NFC. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7d8ffc9cfb5ea83aa9e4a720cfaf2e257354400e;p=platform%2Fupstream%2Fllvm.git Early return. NFC. llvm-svn: 228106 --- diff --git a/lld/lib/ReaderWriter/LinkerScript.cpp b/lld/lib/ReaderWriter/LinkerScript.cpp index 9d3619d..339100f 100644 --- a/lld/lib/ReaderWriter/LinkerScript.cpp +++ b/lld/lib/ReaderWriter/LinkerScript.cpp @@ -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;