Skip to content

Commit

Permalink
why is pmd so stupid
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam- committed Jun 23, 2024
1 parent 868afc9 commit aa8be11
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ else if (sidx > tidx)
public int count(int itemId)
{
int c = 0;
for (int i = 0; i < layout.length; ++i)
for (int value : layout)
{
if (layout[i] == itemId)
if (value == itemId)
{
++c;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ void layout(Layout l)

for (ItemMatcher matcher : matchers)
{
for (int pos = 0; pos < layoutScratch.length; ++pos)
// tagged item id
for (int itemId : layoutScratch)
{
int itemId = layoutScratch[pos]; // tagged item id
if (itemId == -1 || layoutToBank.containsKey(itemId))
{
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,12 @@ public void onScriptCallbackEvent(ScriptCallbackEvent event)
{
if (event.getEventName().equals("bankBuildTab"))
{
var stack = client.getIntStack();
var sz = client.getIntStackSize();

// Use the per-tab view when we want to hide the separators to avoid having to reposition items &
// recomputing the scroll height.
if (activeTab != null && (tagTabActive || config.removeSeparators() || activeTab.hasLayout()))
{
var stack = client.getIntStack(); // NOPMD: UnusedLocalVariable
var sz = client.getIntStackSize();
stack[sz - 1] = 1; // use single tab view mode
}
}
Expand Down

0 comments on commit aa8be11

Please sign in to comment.