Is that style of checking for equality instead of doing an unconditional assign really saving time?
As a general rule assignments are always more expensive on cpu resources than reads and lookups ("if" merely checks a value without changing it). There are perhaps exceptions, but assignments require copying of data from one location to another in memory/registers, which generally takes longer than simply reading the value of data.
Given the present speed of processors and number of cores and caching mechanisms available there is of course no discernible difference in program speed between including the check for equality (or inequality) and forcing the assignment whether or not it is actually needed. It is unlikely to save a time-consuming disk access.
Nevertheless, it is a principle worth perpetuating to avoid making unnecessary assignments in code. As rvk mentions it can also avoid causing side-effects in some cases, as well as avoiding a waste of cpu cycles.