You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@orc.apache.org by "Panagiotis Garefalakis (Jira)" <ji...@apache.org> on 2021/08/02 11:52:00 UTC

[jira] [Commented] (ORC-897) optimization loop termination condition in readerIsCompatible method

    [ https://issues.apache.org/jira/browse/ORC-897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17391531#comment-17391531 ] 

Panagiotis Garefalakis commented on ORC-897:
--------------------------------------------

Resolved via https://github.com/apache/orc/pull/803 
Thanks for contributing [~Guiyankuang] ! 

> optimization loop termination condition in readerIsCompatible method
> --------------------------------------------------------------------
>
>                 Key: ORC-897
>                 URL: https://issues.apache.org/jira/browse/ORC-897
>             Project: ORC
>          Issue Type: Improvement
>          Components: Java
>            Reporter: Yiqun Zhang
>            Assignee: Yiqun Zhang
>            Priority: Trivial
>
> {code:java}
>   private static boolean sameKeys(EncryptionKey[] first,
>                                   EncryptionKey[] next) {
>     if (first.length != next.length) {
>       return false;
>     }
>     for(int k = 0; k < first.length && k < next.length; ++k) {
>       if (!first[k].getKeyName().equals(next[k].getKeyName()) ||
>           first[k].getKeyVersion() != next[k].getKeyVersion() ||
>           first[k].getAlgorithm() != next[k].getAlgorithm()) {
>         return false;
>       }
>     }
>     return true;
>   }
> {code}
> {color:red}k < next.length{color} is not necessary
> There are five similar codes.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)