mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00
Remove redundant else
This commit is contained in:
parent
646dc29eec
commit
0ee5b318b3
11 changed files with 21 additions and 28 deletions
|
@ -394,7 +394,7 @@ alias versionFile = makeRule!((builder, rule) {
|
|||
{
|
||||
if ('0' <= version_[i] && version_[i] <= '9')
|
||||
continue;
|
||||
else if (version_[i] == '.')
|
||||
if (version_[i] == '.')
|
||||
break;
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -546,7 +546,7 @@ void brcombine(ref GlobalOptimizer go)
|
|||
}
|
||||
else if (list_next(b3.Bpred) || b3 == bo.startblock)
|
||||
continue;
|
||||
else if ((bc2 == BCretexp && b3.BC == BCretexp)
|
||||
if ((bc2 == BCretexp && b3.BC == BCretexp)
|
||||
//|| (bc2 == BCret && b3.BC == BCret)
|
||||
)
|
||||
{
|
||||
|
|
|
@ -50,16 +50,13 @@ extern (C++) final class Import : Dsymbol
|
|||
// import [aliasId] = std.stdio;
|
||||
return aliasId;
|
||||
}
|
||||
else if (packages.length > 0)
|
||||
if (packages.length > 0)
|
||||
{
|
||||
// import [std].stdio;
|
||||
return packages[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
// import [id];
|
||||
return id;
|
||||
}
|
||||
// import [id];
|
||||
return id;
|
||||
}
|
||||
|
||||
super(loc, selectIdent());
|
||||
|
|
|
@ -6629,7 +6629,7 @@ private extern(C++) class SearchVisitor : Visitor
|
|||
s = b.sym.search(loc, ident, flags);
|
||||
if (!s)
|
||||
continue;
|
||||
else if (s == cd) // happens if s is nested in this and derives from this
|
||||
if (s == cd) // happens if s is nested in this and derives from this
|
||||
s = null;
|
||||
else if (!(flags & SearchOpt.ignoreVisibility) && !(s.visible().kind == Visibility.Kind.protected_) && !symbolIsVisible(cd, s))
|
||||
s = null;
|
||||
|
|
|
@ -910,7 +910,7 @@ extern (C++) final class TemplateDeclaration : ScopeDsymbol
|
|||
*/
|
||||
extern (D) TemplateTupleParameter isVariadic()
|
||||
{
|
||||
size_t dim = parameters.length;
|
||||
const dim = parameters.length;
|
||||
if (dim == 0)
|
||||
return null;
|
||||
return (*parameters)[dim - 1].isTemplateTupleParameter();
|
||||
|
|
|
@ -2805,11 +2805,11 @@ extern (C++) final class FuncExp : Expression
|
|||
{
|
||||
if (td)
|
||||
return new FuncExp(loc, td.syntaxCopy(null));
|
||||
else if (fd.semanticRun == PASS.initial)
|
||||
if (fd.semanticRun == PASS.initial)
|
||||
return new FuncExp(loc, fd.syntaxCopy(null));
|
||||
else // https://issues.dlang.org/show_bug.cgi?id=13481
|
||||
// Prevent multiple semantic analysis of lambda body.
|
||||
return new FuncExp(loc, fd);
|
||||
// https://issues.dlang.org/show_bug.cgi?id=13481
|
||||
// Prevent multiple semantic analysis of lambda body.
|
||||
return new FuncExp(loc, fd);
|
||||
}
|
||||
|
||||
override const(char)* toChars() const
|
||||
|
@ -3573,10 +3573,9 @@ TypeFunction calledFunctionType(CallExp ce)
|
|||
t = t.toBasetype();
|
||||
if (auto tf = t.isTypeFunction())
|
||||
return tf;
|
||||
else if (auto td = t.isTypeDelegate())
|
||||
if (auto td = t.isTypeDelegate())
|
||||
return td.nextOf().isTypeFunction();
|
||||
else
|
||||
return null;
|
||||
return null;
|
||||
}
|
||||
|
||||
FuncDeclaration isFuncAddress(Expression e, bool* hasOverloads = null) @safe
|
||||
|
|
|
@ -2993,7 +2993,7 @@ extern (D) bool checkNRVO(FuncDeclaration fd)
|
|||
auto v = ve.var.isVarDeclaration();
|
||||
if (!v || v.isReference())
|
||||
return false;
|
||||
else if (fd.nrvo_var is null)
|
||||
if (fd.nrvo_var is null)
|
||||
{
|
||||
// Variables in the data segment (e.g. globals, TLS or not),
|
||||
// parameters and closure variables cannot be NRVOed.
|
||||
|
|
|
@ -643,7 +643,7 @@ class Lexer
|
|||
|
||||
if (isidchar(c))
|
||||
continue;
|
||||
else if (c & 0x80)
|
||||
if (c & 0x80)
|
||||
{
|
||||
const s = p;
|
||||
const u = decodeUTF();
|
||||
|
|
|
@ -1333,7 +1333,7 @@ private extern(C++) final class Semantic3Visitor : Visitor
|
|||
// Don't allow D `immutable` and `shared` types to be interfaced with C++
|
||||
if (type.isImmutable() || type.isShared())
|
||||
return true;
|
||||
else if (Type cpptype = target.cpp.parameterType(type))
|
||||
if (Type cpptype = target.cpp.parameterType(type))
|
||||
type = cpptype;
|
||||
|
||||
if (origType is null)
|
||||
|
|
|
@ -1115,7 +1115,7 @@ extern (C++) struct Target
|
|||
}
|
||||
else if ((isX86_64 || isAArch64) && sd.numArgTypes() == 0)
|
||||
return true;
|
||||
else if (sd.isPOD())
|
||||
if (sd.isPOD())
|
||||
{
|
||||
switch (sz)
|
||||
{
|
||||
|
|
|
@ -1758,13 +1758,10 @@ pure @safe:
|
|||
|
||||
if (parseMangledNameArg())
|
||||
continue;
|
||||
else
|
||||
{
|
||||
dst.len = l;
|
||||
pos = p;
|
||||
brp = b;
|
||||
debug(trace) printf( "not a mangled name arg\n" );
|
||||
}
|
||||
dst.len = l;
|
||||
pos = p;
|
||||
brp = b;
|
||||
debug(trace) printf( "not a mangled name arg\n" );
|
||||
}
|
||||
if ( isDigit( front ) && isDigit( peek( 1 ) ) )
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue