Skip to content

Commit 4e752ff

Browse files
committed
Factorized conditions.
1 parent ed06583 commit 4e752ff

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

External/Plugins/ASCompletion/Completion/ASComplete.cs

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2331,32 +2331,35 @@ static public void HandleAllClassesCompletion(ScintillaControl Sci, string tail,
23312331
known = found;
23322332
}
23332333
}
2334-
2335-
if (ASContext.Context.Features.hasDelegates && !ASContext.Context.CurrentClass.IsVoid())
2334+
2335+
if (!ASContext.Context.CurrentClass.IsVoid())
23362336
{
2337-
MemberList delegates = new MemberList();
2337+
if (ASContext.Context.Features.hasDelegates)
2338+
{
2339+
MemberList delegates = new MemberList();
23382340

2339-
foreach (MemberModel field in ASContext.Context.CurrentClass.Members)
2340-
if ((field.Flags & FlagType.Delegate) > 0)
2341-
delegates.Add(field);
2341+
foreach (MemberModel field in ASContext.Context.CurrentClass.Members)
2342+
if ((field.Flags & FlagType.Delegate) > 0)
2343+
delegates.Add(field);
23422344

2343-
if (delegates.Count > 0)
2344-
{
2345-
delegates.Sort();
2346-
delegates.Merge(known);
2347-
known = delegates;
2345+
if (delegates.Count > 0)
2346+
{
2347+
delegates.Sort();
2348+
delegates.Merge(known);
2349+
known = delegates;
2350+
}
23482351
}
2349-
}
23502352

2351-
if (ASContext.Context.Features.hasGenerics && !ASContext.Context.CurrentClass.IsVoid())
2352-
{
2353-
var typeParams = GetVisibleTypeParameters();
2354-
2355-
if (typeParams != null && typeParams.Items.Count > 0)
2353+
if (ASContext.Context.Features.hasGenerics)
23562354
{
2357-
typeParams.Add(known);
2358-
typeParams.Sort();
2359-
known = typeParams;
2355+
var typeParams = GetVisibleTypeParameters();
2356+
2357+
if (typeParams != null && typeParams.Items.Count > 0)
2358+
{
2359+
typeParams.Add(known);
2360+
typeParams.Sort();
2361+
known = typeParams;
2362+
}
23602363
}
23612364
}
23622365

0 commit comments

Comments
 (0)