#inverting a linkedhashmap
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
why are you trying to do that ?
i'm iterating trough a keyset and i need an inversed insertion order
You can't really do that currently afaik, unless maybe you create a class with logic which does that 🤔
But note that soon java will have such a thing, but it's not ready yet
i used collections.reverse and turned the keyset in a list
well, if you do a copy, yes it works, but you don't want to copy it each time do you ?
i made it outside of the for loop
and then i iterate inside it in the for
yes you can do that
but that's not a good solution
and there is no real good solution currently in java
either you make a complex class
or you do a copy each time
i'll stick to the bad solution since it'd take too much to write my own logic