mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 13:46:43 +00:00
Fix unreachable code
Coverity issues 23292 and 23297.
This commit is contained in:
parent
a22f7b7001
commit
eba0bbe503
@ -1074,18 +1074,20 @@ String const doSplit(String const & a, String & piece, Char delim)
|
||||
size_t i = a.find(delim);
|
||||
if (i == a.length() - 1) {
|
||||
piece = a.substr(0, i);
|
||||
} else if (i != String::npos) {
|
||||
piece = a.substr(0, i);
|
||||
tmp = a.substr(i + 1);
|
||||
} else if (i == 0) {
|
||||
piece.erase();
|
||||
tmp = a.substr(i + 1);
|
||||
} else if (i != String::npos) {
|
||||
piece = a.substr(0, i);
|
||||
tmp = a.substr(i + 1);
|
||||
} else {
|
||||
piece = a;
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
// FIXME: why is this specialization needed?
|
||||
template<typename Char> inline
|
||||
docstring const doSplit(docstring const & a, docstring & piece, Char delim)
|
||||
{
|
||||
@ -1093,12 +1095,12 @@ docstring const doSplit(docstring const & a, docstring & piece, Char delim)
|
||||
size_t i = a.find(delim);
|
||||
if (i == a.length() - 1) {
|
||||
piece = a.substr(0, i);
|
||||
} else if (i != docstring::npos) {
|
||||
piece = a.substr(0, i);
|
||||
tmp = a.substr(i + 1);
|
||||
} else if (i == 0) {
|
||||
piece.erase();
|
||||
tmp = a.substr(i + 1);
|
||||
} else if (i != docstring::npos) {
|
||||
piece = a.substr(0, i);
|
||||
tmp = a.substr(i + 1);
|
||||
} else {
|
||||
piece = a;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user