Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1492 from huoyaoyuan/linq
Use Linq.Append and Prepend.
  • Loading branch information
peppy committed Apr 3, 2018
2 parents 85b3494 + 8a4c819 commit 6852878
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion osu.Framework/Input/FrameworkActionContainer.cs
Expand Up @@ -20,7 +20,7 @@ public class FrameworkActionContainer : KeyBindingContainer<FrameworkAction>

protected override bool Prioritised => true;

protected override IEnumerable<Drawable> KeyBindingInputQueue => new[] { Child }.Concat(base.KeyBindingInputQueue);
protected override IEnumerable<Drawable> KeyBindingInputQueue => base.KeyBindingInputQueue.Prepend(Child);
}

public enum FrameworkAction
Expand Down
4 changes: 2 additions & 2 deletions osu.Framework/Input/InputManager.cs
Expand Up @@ -670,7 +670,7 @@ private bool handleKeyDown(InputState state, Key key, bool repeat)
{
IEnumerable<Drawable> queue = inputQueue;
if (!unfocusIfNoLongerValid())
queue = new[] { FocusedDrawable }.Concat(queue);
queue = queue.Prepend(FocusedDrawable);

return PropagateKeyDown(queue, state, new KeyDownEventArgs { Key = key, Repeat = repeat });
}
Expand All @@ -696,7 +696,7 @@ private bool handleKeyUp(InputState state, Key key)
{
IEnumerable<Drawable> queue = inputQueue;
if (!unfocusIfNoLongerValid())
queue = new[] { FocusedDrawable }.Concat(queue);
queue = queue.Prepend(FocusedDrawable);

return PropagateKeyUp(queue, state, new KeyUpEventArgs { Key = key });
}
Expand Down
2 changes: 1 addition & 1 deletion osu.Framework/Testing/DynamicClassCompiler.cs
Expand Up @@ -148,7 +148,7 @@ private void recompile()
DYNAMIC_ASSEMBLY_NAME,
requiredFiles.Select(file => CSharpSyntaxTree.ParseText(File.ReadAllText(file), null, file))
// Compile the assembly with a new version so that it replaces the existing one
.Concat(new[] { CSharpSyntaxTree.ParseText($"using System.Reflection; [assembly: AssemblyVersion(\"{assemblyVersion}\")]") })
.Append(CSharpSyntaxTree.ParseText($"using System.Reflection; [assembly: AssemblyVersion(\"{assemblyVersion}\")]"))
,
references,
options
Expand Down

0 comments on commit 6852878

Please sign in to comment.