You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by gi...@git.apache.org on 2017/04/10 21:14:45 UTC

[GitHub] tonysun83 commented on a change in pull request #471: Use efficient set storage for field names

tonysun83 commented on a change in pull request #471: Use efficient set storage for field names
URL: https://github.com/apache/couchdb/pull/471#discussion_r110765191
 
 

 ##########
 File path: src/mango/src/mango_native_proc.erl
 ##########
 @@ -257,15 +257,10 @@ add_default_text_field([_ | Rest], Acc) ->
 
 
 %% index of all field names
-get_field_names([], FAcc) ->
-    FAcc;
-get_field_names([{Name, _Type, _Value} | Rest], FAcc) ->
-    case lists:member([<<"$fieldnames">>, Name, []], FAcc) of
-        true ->
-            get_field_names(Rest, FAcc);
-        false ->
-            get_field_names(Rest, [[<<"$fieldnames">>, Name, []] | FAcc])
-    end.
+get_field_names(Fields) ->
+    GBFieldSet = gb_sets:from_list(Fields),
 
 Review comment:
   @iilyak : we're ignoring it below when use the list comprehension to build the return value. Do you think it's  more efficient to build the gb_set without the value rather than just converting the whole thing?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services