[Groonga-commit] groonga/groonga-query-log [master] extractor: check if command is target only when a command option is specified

Back to archive index

Haruka Yoshihara null+****@clear*****
Fri Dec 14 18:15:27 JST 2012


Haruka Yoshihara	2012-12-14 18:15:27 +0900 (Fri, 14 Dec 2012)

  New Revision: 3e092fbfde42d05c3419bb980366431d3efa2a10
  https://github.com/groonga/groonga-query-log/commit/3e092fbfde42d05c3419bb980366431d3efa2a10

  Log:
    extractor: check if command is target only when a command option is specified

  Modified files:
    lib/groonga/query-log/extractor.rb

  Modified: lib/groonga/query-log/extractor.rb (+11 -6)
===================================================================
--- lib/groonga/query-log/extractor.rb    2012-12-14 18:13:40 +0900 (bce755c)
+++ lib/groonga/query-log/extractor.rb    2012-12-14 18:15:27 +0900 (36b5494)
@@ -44,13 +44,18 @@ module Groonga
       private
       def target?(command)
         name = command.name
-        if****@optio*****? {|target_command| target_command === name}
-          true
-        elsif****@optio*****_commands.any? {|exclude_command| exclude_command == name}
-          false
-        else
-          true
+        commands =****@optio*****
+        exclude_commands =****@optio*****_commands
+
+        unless commands.empty?
+          return commands.include?(name)
+        end
+
+        unless exclude_commands.empty?
+          return (not exclude_commands.include?(name))
         end
+
+        true
       end
 
       def setup_options
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index