[hack] Rewrite File_content.apply_edit
[hack] Rewrite File_content.apply_edit

Summary: This function is wrong (new unit test would fail), and I don't feel like it's salvageable. Rewriting it completely to be more clear. There is some opportunity for memoization there, but leaving this as micro optimization for the future.

Reviewed By: alexchow

Differential Revision: D3941881

fbshipit-source-id: 22a47a63e5b162fbf42891ce8d45722600eda8a9

fletcherw/flow,fletcherw/flow,mroch/flow,gabro/flow,gabelevi/flow,AprilArcus/flow,facebook/flow,jamesgpearce/flow,ForbesLindesay/flow,ForbesLindesay/flow,gabro/flow,popham/flow,facebook/flow,jamesgpearce/flow,popham/flow,facebook/flow,nmote/flow,ylu1317/flow,AprilArcus/flow,fletcherw/flow,jgrund/flow,gabelevi/flow,gabelevi/flow,nmote/flow,gabro/flow,mroch/flow,MichaelDeBoey/flow,samwgoldman/flow,nmote/flow,AgentME/flow,jgrund/flow,ForbesLindesay/flow,ForbesLindesay/flow,popham/flow,gabelevi/flow,nmote/flow,TiddoLangerak/flow,mroch/flow,TiddoLangerak/flow,samwgoldman/flow,popham/flow,AgentME/flow,claudiopro/flow,mroch/flow,mroch/flow,nmote/flow,ylu1317/flow,MichaelDeBoey/flow,jamesgpearce/flow,samwgoldman/flow,AprilArcus/flow,gabro/flow,TiddoLangerak/flow,JonathanUsername/flow,samwgoldman/flow,ylu1317/flow,MichaelDeBoey/flow,AprilArcus/flow,jamesgpearce/flow,TiddoLangerak/flow,MichaelDeBoey/flow,gabro/flow,nmote/flow,popham/flow,fletcherw/flow,gabro/flow,fletcherw/flow,AgentME/flow,gabelevi/flow,nmote/flow,facebook/flow,fletcherw/flow,mroch/flow,samwgoldman/flow,facebook/flow,JonathanUsername/flow,jgrund/flow,ForbesLindesay/flow,AgentME/flow,TiddoLangerak/flow,claudiopro/flow,popham/flow,facebook/flow,JonathanUsername/flow,gabelevi/flow,AgentME/flow,jamesgpearce/flow,claudiopro/flow,claudiopro/flow,samwgoldman/flow,jamesgpearce/flow,jamesgpearce/flow,gabelevi/flow,AprilArcus/flow,JonathanUsername/flow,jgrund/flow,ForbesLindesay/flow,MichaelDeBoey/flow,JonathanUsername/flow,samwgoldman/flow,claudiopro/flow,facebook/flow,popham/flow,jgrund/flow,ylu1317/flow,JonathanUsername/flow,ylu1317/flow,jgrund/flow,mroch/flow,JonathanUsername/flow,AprilArcus/flow