anchor.diff:          L :: [ parsed_field() ] ) ->
       { Found ::[ piqirun_return_buffer() ], Rest :: [ parsed_field() ]}.
   
  -% find record field by code
  +% find record fields by code
   find_fields(Code, L) ->
  -    find_fields(Code, L, [], []).
  -
  -
  -find_fields(_Code, [], Accu, Rest) ->
  -    {lists:reverse(Accu), lists:reverse(Rest)};
  -find_fields(Code, [{Code, X} | T], Accu, Rest) ->
  -    find_fields(Code, T, [X | Accu], Rest);
  -find_fields(Code, [H | T], Accu, Rest) ->
  -    find_fields(Code, T, Accu, [H | Rest]).
  +    {RevRes, Rest} = find_fields_rev(Code, L),
  +    {lists:reverse(RevRes), Rest}.
  +
  +
  +% find record fields by code and return the list of found fields in reverse
  +% order
  +find_fields_rev(Code, L) ->
  +    find_fields_rev(Code, L, [], []).
  +
  +
  +find_fields_rev(_Code, [], Accu, Rest) ->
  +    {Accu, lists:reverse(Rest)};
  +find_fields_rev(Code, [{Code, X} | T], Accu, Rest) ->
  +    find_fields_rev(Code, T, [X | Accu], Rest);
  +find_fields_rev(Code, [H | T], Accu, Rest) ->
  +    find_fields_rev(Code, T, Accu, [H | Rest]).
   
   
   -spec throw_error/1 :: (any()) -> no_return().
  
positive.code: 
  
  parse_optional_field(Code, ParseValue, L) ->
      {Fields, Rest} = find_fields(Code, L),
      Res = 
          case Fields of
              [] -> 'undefined';
  
negative.code: %%
  %% @doc Piqi runtime library
  %%
  %% Encoding rules follow this specification:
  %%
  %%      http://code.google.com/apis/protocolbuffers/docs/encoding.html
  
  
  -module(piqirun).
  -compile(export_all).
  
  