Skip to content

Commit

Permalink
Very minor view.rb improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
yrashk committed May 1, 2008
1 parent 5a76991 commit e4d1c70
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/strokedb/views/view.rb
Expand Up @@ -16,7 +16,7 @@ module StrokeDB
# or to <tt>false</tt> if the size is not fixed.
# Note: optimized storage is used when both keys and values are the fixed length.
# I.e. both "value_size" and "key_size" are set.
"value_size" => Util::RAW_UUID_SIZE,
"value_size" => ::StrokeDB::Util::RAW_UUID_SIZE,

# strategy determines whether to index HEADs or particular versions
# When :heads is used, previous versions are removed from the index.
Expand Down Expand Up @@ -239,7 +239,7 @@ def [](*args) # FIXME: it is not nice
store = args.first.is_a?(Store) ? args.shift : StrokeDB.default_store
name = args[0]
nsurl = args[1] || (name.modulize.empty? ? Module.nsurl : name.modulize.constantize.nsurl)
uuid = ::Util.sha1_uuid("view:#{nsurl}##{name}")
uuid = ::StrokeDB::Util.sha1_uuid("view:#{nsurl}##{name}")
store.find(uuid)
end

Expand Down Expand Up @@ -270,7 +270,7 @@ def new(*args, &block)

nsurl = options['nsurl'] ||= name.modulize.empty? ? Module.nsurl : name.modulize.constantize.nsurl # FIXME: it is not nice (and the same shit is in meta.rb)

options['uuid'] = ::Util.sha1_uuid("view:#{nsurl}##{name}")
options['uuid'] = ::StrokeDB::Util.sha1_uuid("view:#{nsurl}##{name}")

unless v = find(options['uuid'])
v = original_new(store, options, &block)
Expand Down

0 comments on commit e4d1c70

Please sign in to comment.