You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by GitBox <gi...@apache.org> on 2021/03/23 15:34:13 UTC

[GitHub] [mina-sshd] lgoldstein commented on a change in pull request #183: [SSHD-1105] Try all configured signature algorithms for a public key

lgoldstein commented on a change in pull request #183:
URL: https://github.com/apache/mina-sshd/pull/183#discussion_r599677422



##########
File path: sshd-core/src/main/java/org/apache/sshd/client/auth/pubkey/UserAuthPublicKey.java
##########
@@ -56,6 +58,7 @@
     protected Iterator<PublicKeyIdentity> keys;
     protected PublicKeyIdentity current;
     protected List<NamedFactory<Signature>> factories;
+    protected List<String> currentAlgorithms = new LinkedList<>();

Review comment:
       A `LinkedList` is not really a `List` and any attempt to use it as such for random access has horrible performance (true for large lists but let's not quibble). Since the code only handles the "edges" (head/tail) I re commend defining it as
   ```java
   Deque<String> currentAlgorithms = new LinkedList<>();
   ```
   and the you can use `removeHead/addTail`/etc. And since `Deque extends Collection` you can also use it as such.




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org