anchor.diff:  	    end
       end.
   
  -update_ast_1({Key, {AnnAST, Info, _CheckSum}}, _State = #state{dets_tab = TabFile, asts = ASTs}) ->
  +update_ast_1({Key, {AnnAST, Info, _CheckSum}}, State = #state{dets_tab = TabFile, asts = ASTs}) ->
       {FileName, _ByPassPreP, _SearchPaths, _TabWidth, _FileFormat} = Key,
       Checksum = wrangler_misc:filehash(FileName),
       case TabFile of
  -	none -> case lists:keysearch(Key, 1, ASTs) of
  -		    {value, {Key, {_AnnAST1, _Info1, _CheckSum}}} ->
  -			#state{asts = lists:keyreplace(Key, 1, ASTs, {Key, {AnnAST, Info, Checksum}})};
  -		    false ->
  -			#state{asts = [{Key, {AnnAST, Info, Checksum}}| ASTs]}
  -		end;
  +	none -> 
  +            Res = lists:keysearch(Key, 1, ASTs),
  +            case Res of
  +                {value, {Key, _}} ->
  +                    State#state{asts = lists:keyreplace(Key, 1, ASTs, {Key, {AnnAST, Info, Checksum}})};
  +                false ->
  +                    State#state{asts = [{Key, {AnnAST, Info, Checksum}}| ASTs]}
  +            end;                    
   	_ ->
   	    dets:delete(TabFile, Key),
  -	    dets:insert(TabFile, [{Key, {AnnAST, Info, Checksum}}])
  +	    dets:insert(TabFile, [{Key, {AnnAST, Info, Checksum}}]),
  +            State
       end.
       
   log_errors(FileName, Info) ->
  
positive.code: 			    {{ok, {AnnAST1, Info1}}, #state{asts = lists:keyreplace(Key, 1, ASTs, {Key, {AnnAST1, Info1, NewChecksum}})}}
  		    end;
  		false ->
  		    wrangler_error_logger:remove_from_logger(FileName),
  		    {ok, {AnnAST, Info}} = parse_annotate_file(FileName, ByPassPreP, SearchPaths, TabWidth, FileFormat),
  		    log_errors(FileName, Info),
  		    {{ok, {AnnAST, Info}}, #state{asts = [{Key, {AnnAST, Info, wrangler_misc:filehash(FileName)}}| ASTs]}}
  
negative.code: %%-type(modifyTime()::{{integer(), integer(), integer()},{integer(), integer(), integer()}}).
  %%-spec(update_ast/2::({filename(),boolean(), [dir()], integer(), atom()}, {syntaxTree(), moduleInfo(), modifyTime()}) -> ok).
  update_ast(Key={_FileName, _ByPassPreP, _SearchPaths, _TabWidth, _FileFormat}, {AnnAST, Info, CheckSum}) ->
      gen_server:call(wrangler_ast_server, {update, {Key, {AnnAST, Info, CheckSum}}});
  update_ast(Key={FileName, ByPassPreP, SearchPaths, TabWidth, FileFormat}, SwpFileName) ->
      {ok, {AnnAST, Info}} = parse_annotate_file(SwpFileName, ByPassPreP, SearchPaths, TabWidth, FileFormat),
      CheckSum = wrangler_misc:filehash(FileName),
      gen_server:call(wrangler_ast_server, {update, {Key, {AnnAST, Info, CheckSum}}}).
   
  get_temp_dir() ->
      gen_server:call(wrangler_ast_server, get_temp_dir).
  