You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2019/08/14 21:16:21 UTC

[GitHub] [couchdb] jaydoane commented on a change in pull request #2101: Refactor fabric:cleanup_index_files

jaydoane commented on a change in pull request #2101: Refactor fabric:cleanup_index_files
URL: https://github.com/apache/couchdb/pull/2101#discussion_r314047597
 
 

 ##########
 File path: src/fabric/src/fabric.erl
 ##########
 @@ -503,26 +504,29 @@ cleanup_index_files() ->
 %% @doc clean up index files for a specific db
 -spec cleanup_index_files(dbname()) -> ok.
 cleanup_index_files(DbName) ->
+    [file:delete(File) || File <- non_active_index_files(DbName)],
 
 Review comment:
   I generally prefer `lists:foreach` when I don't care about the value, and in this case, we're just throwing away the result of the list comprehension. On a related note, should we check the result of `file:delete` here? EDIT: Oh, I see you just copied the existing code, but I still wonder if it shouldn't be improved?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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