[CLOSED] Unnecessary declaration of initialized variable _i lazarus / 64-FPC development ---------------------------------------------------------------------- lagprogramming · 2024-01-28 11:17 packages/x11/src/xinput.pp has Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure FindTypeAndClass(d: PXDevice; out event_type: cint; out event_class: TXEventClass; classid: cuchar; offset: cint); inline;var  _i : cint = 0;  _ip: PXInputClassInfo;begin  event_type := 0;  event_class := 0;   _ip := d^.classes;  for _i := 0 to d^.num_classes - 1 do  begin    if _ip^.input_class = classid then    begin      event_type := _ip^.event_type_base + offset;      event_class := (d^.device_id shl 8) or event_type;    end;    Inc(_ip);  end;end;The initial zero value of variable _i is rewritten later at the "for" loop, which means _i can be an ordinary variable, not an initialized one. The following patch makes _i an ordinary variable. ---------------------------------------------------------------------- AlexTP · 2024-01-30 05:23 Changed (via your patch) or not changed. What's the difference. It don't make sense to report this and take devs' time. ---------------------------------------------------------------------- lagprogramming · 2024-01-30 13:53 Quote from: AlexTP on January 30, 2024, 06:23:56 amChanged (via your patch) or not changed. What's the difference. It don't make sense to report this and take devs' time. It's called Kaizen. It's a philosophy of improving things in small steps. In software development Agile philosophy is the standard. The mindset to embrace change is common for both Agile and Kaizen. Unless a change comes with drawbacks(for example a reduced code readability), even if the benefits are minor, the change should be accepted. In time, the number of microimprovements is expected to decrease due to the fact that the official source code gets better.