A method and system for optimizing computer source code is provided. Prior
to compiling the source code, the code is analyzed to determine the
occurrence of repeating patterns of code. The repeating patterns of code
are replaced with a programming loop that executes a single instance of
the pattern multiple times using appropriate array indices and loop
increments. In this manner, source code size is reduced making transfer,
storage and compiling more efficient.