Doesn't matter here, but as a general rule, it's better not to have unspecified side effects on the input arguments, so it might be good to consider cloning the input lists.