Don't Repeat Yourself (DRY) is a process philosophy aimed at reducing duplication, particularly in computing - aka Once and Only Once or Single Point of Truth (SPOT). The principle states that information should not be duplicated, because duplication increases the difficulty of change, may decrease clarity, and leads to opportunities for inconsistency. DRY is a core principle in "The Pragmatic Programmer" by Andy Hunt and Dave Thomas.
Why didn't you put that piece of code in a function? DRY!