Converts a function argument to Set if it may improve performance.