Skip to content

Commit

Permalink
utils: determine features on require
Browse files Browse the repository at this point in the history
There seem to be no reason to determine features on request instead of
require since this operation is cheap.

Part of #422
  • Loading branch information
DifferentialOrange committed Mar 20, 2024
1 parent f790d54 commit a56e7e9
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions crud/common/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -664,51 +664,29 @@ local function determine_enabled_features()
2, 2, 0, nil)
end

function utils.tarantool_supports_fieldpaths()
if enabled_tarantool_features.fieldpaths == nil then
determine_enabled_features()
end
determine_enabled_features()

function utils.tarantool_supports_fieldpaths()
return enabled_tarantool_features.fieldpaths
end

function utils.tarantool_supports_uuids()
if enabled_tarantool_features.uuids == nil then
determine_enabled_features()
end

return enabled_tarantool_features.uuids
end

function utils.tarantool_supports_jsonpath_indexes()
if enabled_tarantool_features.jsonpath_indexes == nil then
determine_enabled_features()
end

return enabled_tarantool_features.jsonpath_indexes
end

function utils.tarantool_has_builtin_merger()
if enabled_tarantool_features.builtin_merger == nil then
determine_enabled_features()
end

return enabled_tarantool_features.builtin_merger
end

function utils.tarantool_supports_external_merger()
if enabled_tarantool_features.external_merger == nil then
determine_enabled_features()
end

return enabled_tarantool_features.external_merger
end

function utils.tarantool_supports_netbox_skip_header_option()
if enabled_tarantool_features.netbox_skip_header_option == nil then
determine_enabled_features()
end

return enabled_tarantool_features.netbox_skip_header_option
end

Expand Down

0 comments on commit a56e7e9

Please sign in to comment.