ForgeFlower icon indicating copy to clipboard operation
ForgeFlower copied to clipboard

Scope Leak in enchanced for loops.

Open LexManos opened this issue 6 years ago • 0 comments

   public void func_216099_a(ValidationResults p_216099_1_, Function<ResourceLocation, LootTable> p_216099_2_, Set<ResourceLocation> p_216099_3_, LootParameterSet p_216099_4_) {
      for(int i = 0; i < this.poolConditions.size(); ++i) {
         this.poolConditions.get(i).func_215856_a(p_216099_1_.func_216108_b(".condition[" + i + "]"), p_216099_2_, p_216099_3_, p_216099_4_);
      }

      for(int j = 0; j < this.field_216102_d.length; ++j) {
         this.field_216102_d[j].func_215856_a(p_216099_1_.func_216108_b(".functions[" + j + "]"), p_216099_2_, p_216099_3_, p_216099_4_);
      }

      for(int k = 0; k < this.lootEntries.size(); ++k) {
         this.lootEntries.get(k).func_216142_a(p_216099_1_.func_216108_b(".entries[" + k + "]"), p_216099_2_, p_216099_3_, p_216099_4_);
      }

   }

All indexes SHOULD be 'i', as they do not leak out and should not effect each other's naming schemes.

LexManos avatar May 28 '19 23:05 LexManos