To avoid edge cases, I would rather use the following condition:
   ``i > 0 && currentCompValue != tmpValue``
This supposes that the type of loop has been changed to ensure the order, as explained in my previous comment.

Note that, as ``tmpValue`` is never reset, with the current code it can have a non falsy value even in the first iteration of this (inner) loop for the current property in case it is not the first property to explode.