Is it worth adding a comment at the top of this to say that it's for working out if the input has changed?  I can imagine coming back to this and thinking that it's pulling out values to send elsewhere.