From: Christopher Lees Date: Wed, 12 Jul 2017 21:01:58 +0000 (+0100) Subject: Change: Remove unncessary int assignment from GamePadConfiguration.cs X-Git-Tag: v3.0.0~83^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0880ab1e6d377a0e212a53309fbb7bed61043bb;p=platform%2Fcore%2Fcsapi%2Fopentk.git Change: Remove unncessary int assignment from GamePadConfiguration.cs --- diff --git a/src/OpenTK/Input/GamePadConfiguration.cs b/src/OpenTK/Input/GamePadConfiguration.cs index b82bcdf..799776d 100644 --- a/src/OpenTK/Input/GamePadConfiguration.cs +++ b/src/OpenTK/Input/GamePadConfiguration.cs @@ -167,10 +167,10 @@ namespace OpenTK.Input switch (item[0]) { case 'a': - return new GamePadConfigurationSource(isAxis:true, index:ParseAxis(item)); + return new GamePadConfigurationSource(isAxis:true, index:ParseIndex(item)); case 'b': - return new GamePadConfigurationSource(isAxis:false, index:ParseButton(item)); + return new GamePadConfigurationSource(isAxis:false, index:ParseIndex(item)); case 'h': { @@ -189,25 +189,11 @@ namespace OpenTK.Input /// - # is a zero-based integer number /// /// The string to parse - /// The index of the axis - static int ParseAxis(string item) + /// The index of the axis or button + static int ParseIndex(string item) { // item is in the format "a#" where # a zero-based integer number - int axis = 0; - int id = Int32.Parse(item.Substring(1)); - return axis + id; - } - - /// - /// Parses a string in the format "b#" where: - /// - # is a zero-based integer number - /// - /// The string to parse - /// The index of the button - static int ParseButton(string item) - { - // item is in the format "b#" where # a zero-based integer number - return Int32.Parse(item.Substring(1)); + return Int32.Parse(item.Substring(1)); ; } ///