Pull out helper function
Pull out helper function

Summary: I made it slightly more complicated than it was because in general, the functions we call to continue diffing deeper in the tree may return options.

Reviewed By: panagosg7

Differential Revision: D8776809

fbshipit-source-id: 02a0372e3aa3a50c4ef05f8183ddfa882d2140e9

facebook/flow,popham/flow,AgentME/flow,facebook/flow,JonathanUsername/flow,claudiopro/flow,gabelevi/flow,nmote/flow,nmote/flow,facebook/flow,gabelevi/flow,AgentME/flow,samwgoldman/flow,popham/flow,gabelevi/flow,popham/flow,popham/flow,JonathanUsername/flow,gabelevi/flow,claudiopro/flow,JonathanUsername/flow,samwgoldman/flow,samwgoldman/flow,claudiopro/flow,popham/flow,samwgoldman/flow,jamesgpearce/flow,jamesgpearce/flow,mroch/flow,facebook/flow,jamesgpearce/flow,samwgoldman/flow,jamesgpearce/flow,AgentME/flow,JonathanUsername/flow,claudiopro/flow,JonathanUsername/flow,gabelevi/flow,mroch/flow,gabelevi/flow,samwgoldman/flow,mroch/flow,nmote/flow,nmote/flow,nmote/flow,jamesgpearce/flow,mroch/flow,popham/flow,JonathanUsername/flow,popham/flow,facebook/flow,mroch/flow,jamesgpearce/flow,claudiopro/flow,AgentME/flow,facebook/flow,nmote/flow,nmote/flow,samwgoldman/flow,AgentME/flow,mroch/flow,jamesgpearce/flow,facebook/flow,mroch/flow,JonathanUsername/flow,gabelevi/flow