github-code-scanning[bot] commented on code in PR #2215:
URL: https://github.com/apache/avro/pull/2215#discussion_r1229687123
##########
lang/csharp/src/apache/test/CodGen/CodeGenTest.cs:
##########
@@ -81,6 +82,32 @@
Protocol protocol = null;
Assert.Throws<ArgumentNullException>(() =>
this.GenerateNames(protocol));
}
+
+
+ [Test]
+ public void GetTypesShouldReturnTypes()
+ {
+ AddSchema(@"
+{
+ ""name"": ""PlanetEnum"",
+ ""namespace"": ""Space.Models"",
+ ""type"": ""enum"",
+ ""symbols"": [
+ ""Earth"",
+ ""Mars"",
+ ""Jupiter"",
+ ""Saturn"",
+ ""Uranus"",
+ ""Neptune""
+ ]
+}
+");
+ GenerateCode();
+ var types = GetTypes();
+ Assert.That(types.Count, Is.EqualTo(1));
+ Assert.That(types.ContainsKey("PlanetEnum"));
Review Comment:
## Inefficient use of ContainsKey
Inefficient use of 'ContainsKey' and [indexer](1).
[Show more
details](https://github.com/apache/avro/security/code-scanning/2990)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]