1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 18:47:27 +08:00

Remove all unnecessary parenthesis where object initialisers are used

Enforces at CI.
This commit is contained in:
Dean Herbert 2017-07-13 15:02:45 +09:00
parent 80f88cf5bb
commit de46f3ab07
14 changed files with 15 additions and 15 deletions

View File

@ -198,7 +198,7 @@ namespace osu.Desktop.VisualTests.Tests
AutoSizeAxes = Axes.Both;
Direction = FillDirection.Horizontal;
Add(new OsuSpriteText { Text = header + @": ", TextSize = text_size });
Add(valueText = new OsuSpriteText() { TextSize = text_size });
Add(valueText = new OsuSpriteText { TextSize = text_size });
Margin = new MarginPadding(margin);
}
}

View File

@ -46,7 +46,7 @@ namespace osu.Desktop.VisualTests.Tests
MaxCombo = 123,
Rank = ScoreRank.A,
Date = DateTimeOffset.Now,
Statistics = new Dictionary<string, dynamic>()
Statistics = new Dictionary<string, dynamic>
{
{ "300", 50 },
{ "100", 20 },

View File

@ -186,7 +186,7 @@ namespace osu.Desktop.Overlays
{
private OsuGame game;
protected override Notification CreateCompletionNotification() => new ProgressCompletionNotification()
protected override Notification CreateCompletionNotification() => new ProgressCompletionNotification
{
Text = @"Update ready to install. Click to restart!",
Activated = () =>

View File

@ -91,7 +91,7 @@ namespace osu.Game.Beatmaps.ControlPoints
if (time < list[0].Time)
return prePoint ?? new T();
int index = list.BinarySearch(new T() { Time = time });
int index = list.BinarySearch(new T { Time = time });
// Check if we've found an exact match (t == time)
if (index >= 0)

View File

@ -114,7 +114,7 @@ namespace osu.Game.Graphics.Containers
public SectionsContainer()
{
Add(ScrollContainer = new ScrollContainer()
Add(ScrollContainer = new ScrollContainer
{
RelativeSizeAxes = Axes.Both,
Masking = false,

View File

@ -37,7 +37,7 @@ namespace osu.Game.Overlays.Direct
{
DisplayStyleControl.Dropdown.AccentColour = colours.BlueDark;
Ruleset.BindTo(game?.Ruleset ?? new Bindable<RulesetInfo>() { Value = rulesets.GetRuleset(0) });
Ruleset.BindTo(game?.Ruleset ?? new Bindable<RulesetInfo> { Value = rulesets.GetRuleset(0) });
foreach (var r in rulesets.AllRulesets)
{
modeButtons.Add(new RulesetToggleButton(Ruleset, r));

View File

@ -90,7 +90,7 @@ namespace osu.Game.Overlays.Notifications
private ProgressNotificationState state;
protected virtual Notification CreateCompletionNotification() => new ProgressCompletionNotification()
protected virtual Notification CreateCompletionNotification() => new ProgressCompletionNotification
{
Activated = CompletionClickAction,
Text = $"Task \"{Text}\" has completed!"

View File

@ -29,7 +29,7 @@ namespace osu.Game.Overlays.Settings
if (text == null)
{
// construct lazily for cases where the label is not needed (may be provided by the Control).
Add(text = new OsuSpriteText() { Depth = 1 });
Add(text = new OsuSpriteText { Depth = 1 });
}
text.Text = value;

View File

@ -17,7 +17,7 @@ namespace osu.Game.Overlays.Settings
where T : struct, IEquatable<T>
where U : SliderBar<T>, new()
{
protected override Drawable CreateControl() => new U()
protected override Drawable CreateControl() => new U
{
Margin = new MarginPadding { Top = 5, Bottom = 5 },
RelativeSizeAxes = Axes.X

View File

@ -16,7 +16,7 @@ namespace osu.Game.Screens.Play.ReplaySettings
{
Children = new Drawable[]
{
new ReplaySliderBar<double>()
new ReplaySliderBar<double>
{
LabelText = "Playback speed",
Bindable = config.GetBindable<double>(OsuSetting.PlaybackSpeed)

View File

@ -13,7 +13,7 @@ namespace osu.Game.Screens.Play.ReplaySettings
public class ReplaySliderBar<T> : SettingsSlider<T>
where T : struct, IEquatable<T>
{
protected override Drawable CreateControl() => new Sliderbar()
protected override Drawable CreateControl() => new Sliderbar
{
Margin = new MarginPadding { Top = 5, Bottom = 5 },
RelativeSizeAxes = Axes.X

View File

@ -160,7 +160,7 @@ namespace osu.Game.Screens.Select
Colour = Color4.Black,
Alpha = 0.5f,
},
new FillFlowContainer<MetadataSegment>()
new FillFlowContainer<MetadataSegment>
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,

View File

@ -128,7 +128,7 @@ namespace osu.Game.Screens.Select
// Bottom = 5
// },
//},
sortTabs = new OsuTabControl<SortMode>()
sortTabs = new OsuTabControl<SortMode>
{
RelativeSizeAxes = Axes.X,
Width = 0.5f,

View File

@ -66,8 +66,8 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInAttributeList/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInEnumDeclaration/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInInitializer/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantEmptyObjectCreationArgumentList/@EntryIndexedValue"></s:String>
<s:Boolean x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantEmptyObjectCreationArgumentList/@EntryIndexRemoved">True</s:Boolean>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantEmptyObjectCreationArgumentList/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantExplicitParamsArrayCreation/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantImmediateDelegateInvocation/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantLambdaSignatureParentheses/@EntryIndexedValue">WARNING</s:String>