Changes between Version 4 and Version 5 of Ticket #6433


Ignore:
Timestamp:
03/01/2018 10:16:16 AM (2 years ago)
Author:
mjethani
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #6433 – Description

    v4 v5  
    6767}}} 
    6868 
    69 The loop terminates if the first URL returned is truthy, and in that case the function `getURLsFromElement` does not bother checking the values of the `srcset` attributes and the attribute values of the children. Without generators, the callee would need to know the requirements of the caller up front in order to do this kind of optimization, but with generators the caller decides when to terminate the callee. 
     69The loop terminates if the first URL returned is truthy, and in that case the function `getURLsFromElement` does not bother checking the value of the `srcset` attribute and the attribute values of the children. Without generators, the callee would need to know the requirements of the caller up front in order to do this kind of optimization, but with generators the caller decides when to terminate the callee. 
    7070 
    7171This is already an improvement, but we can go further in terms of code readability. For example, by adopting a functional style: