LinuxCNC / linuxcnc

LinuxCNC controls CNC machines. It can drive milling machines, lathes, 3d printers, laser cutters, plasma cutters, robot arms, hexapods, and more.
http://linuxcnc.org/
GNU General Public License v2.0
1.79k stars 1.15k forks source link

Correct Typo and Remove redundant loop in gcode graphics #2897

Closed satiowadahc closed 7 months ago

andypugh commented 7 months ago

The so - ao looks like a typo, did you work out what the affect was?

The "While 1:" is a fairly common way to allow a block of code to be turned on or off during development. It probably shouldnt have made it to production code. (I did wonder if it was a way to limit the scope of a variable, but apparently that doesn't work in Python)

satiowadahc commented 7 months ago

The while 1 was refactored a year ago. It used to be:

while 1:
   try:
       makebuffer
   except
       makebufferbigger
       continue
   break

weird this caused stack overflows and was refactored to

while 1:
   try
       makebuffer
   except
       meh.
   break
satiowadahc commented 7 months ago

https://github.com/linuxcnc/linuxcnc/commit/67a1e6c796b65a6455135baee310834511fa8a1b