Skip to content

Conversation

@SayantanScience
Copy link

That should be IllegalArgumentException as the argument is illegal, not the internal state. The value key len should be public, or how would one know what is the key length without risking an uncaught exception? And changing method return values to Blake3 inspires more fluent design

That should be IllegalArgumentException as the argument is illegal, not the internal state. The value key len should be public, or how would one know what is the key length without risking an uncaught exception? And changing method return values to Blake3 inspires more fluent design
@jonelo
Copy link

jonelo commented Sep 29, 2021

commit 26644be will cause a NPE later actually. cvStackLen must be decreased first in order to get the correct index, so it should be

cvStackLen--;
int[] toRet=cvStack[cvStackLen];
cvStack[cvStackLen]=null;
return toRet;

@SayantanScience
Copy link
Author

Actually its much better to use the java.util.Stack<int[]> class and you get all those memory management for free. That's what I did while implementing Blake3 myself. And yes your point is correct. I was really not that careful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants