Skip to content

Commit 4281e4d

Browse files
committed
Re-ordered list of built-in type parsers so the most used parsers are at the top, reducing the search time for commonly used types
1 parent c4d3d22 commit 4281e4d

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

src/AtleX.CommandLineArguments/Configuration/CommandLineArgumentsConfiguration.cs

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,24 @@ public CommandLineArgumentsConfiguration()
7979

8080
this._typeParsers = new List<TypeParser>()
8181
{
82-
new BoolTypeParser(),
83-
new ByteTypeParser(),
84-
new CharTypeParser(),
85-
new DateTimeTypeParser(),
86-
new DecimalTypeParser(),
87-
new DoubleTypeParser(),
88-
new FloatTypeParser(),
89-
new IntTypeParser(),
90-
new LongTypeParser(),
91-
new ShortTypeParser(),
92-
new StringTypeParser(),
82+
/*
83+
This is ordered by most likely type parsers first so searching
84+
for the correct type parser can be slightly faster for the most
85+
used types
86+
*/
87+
new StringTypeParser(),
88+
new BoolTypeParser(),
89+
new IntTypeParser(),
90+
91+
new FloatTypeParser(),
92+
new DoubleTypeParser(),
93+
new DateTimeTypeParser(),
94+
95+
new ByteTypeParser(),
96+
new CharTypeParser(),
97+
new DecimalTypeParser(),
98+
new LongTypeParser(),
99+
new ShortTypeParser(),
93100
};
94101
}
95102

0 commit comments

Comments
 (0)