smart_schema 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +4 -4
- data/lib/smart_core/schema/checker/verifiable_hash.rb +8 -5
- data/lib/smart_core/schema/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 027d45dbb44df86b67e3ddc73b11f045630f54d7b9e02cb797ef58afd1bead0f
|
4
|
+
data.tar.gz: 35a7394123713a17fa5ef021a7f17ad6fe9667daf88780a981e89a5470bcaefc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d214fb0bd2cfca61d373c48a426ae55d027ef1955a0f718f74303f209bf7aea6a164ab79b4718bdca1bb5d18aa2ad00f8e6fe8f7ec107284dfe753931915df1
|
7
|
+
data.tar.gz: 80be7069b581290cf95223272662c17f5b2058defe11d5d2ff09d13952af0fd36006ca383ccda7c2dbc163533076d34a3c6c1693699740299d38eb466dc9bfd0
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
# [0.7.0] - 2022-09-28
|
5
|
+
## Changed
|
6
|
+
- Started the total code refactoring in order to decrease object and memory allocations:
|
7
|
+
- Decreased object allocations in `SmartCore::Schema::Checker::VerifiableHash#fetch(key)`
|
8
|
+
|
4
9
|
# [0.6.0] - 2022-09-27
|
5
10
|
## Added
|
6
11
|
- Now `Forwardable` module has explicit requiring in order to support *Ruby@3.1* (`lib/smart_core/smart_schema.rb#6`);
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
smart_schema (0.
|
4
|
+
smart_schema (0.7.0)
|
5
5
|
smart_engine (~> 0.11)
|
6
6
|
smart_types (~> 0.4)
|
7
7
|
|
@@ -83,8 +83,8 @@ GEM
|
|
83
83
|
simplecov_json_formatter (~> 0.1)
|
84
84
|
simplecov-html (0.12.3)
|
85
85
|
simplecov_json_formatter (0.1.2)
|
86
|
-
smart_engine (0.
|
87
|
-
smart_types (0.
|
86
|
+
smart_engine (0.12.0)
|
87
|
+
smart_types (0.7.1)
|
88
88
|
smart_engine (~> 0.11)
|
89
89
|
tzinfo (2.0.4)
|
90
90
|
concurrent-ruby (~> 1.0)
|
@@ -104,4 +104,4 @@ DEPENDENCIES
|
|
104
104
|
smart_schema!
|
105
105
|
|
106
106
|
BUNDLED WITH
|
107
|
-
2.
|
107
|
+
2.3.0.dev
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
# @api private
|
4
4
|
# @since 0.1.0
|
5
|
+
# @version 0.7.0
|
5
6
|
class SmartCore::Schema::Checker::VerifiableHash
|
6
7
|
# @return [Hash<String|Symbol,Any>]
|
7
8
|
#
|
@@ -50,14 +51,16 @@ class SmartCore::Schema::Checker::VerifiableHash
|
|
50
51
|
#
|
51
52
|
# @api private
|
52
53
|
# @since 0.1.0
|
54
|
+
# @version 0.7.0
|
53
55
|
def fetch(key)
|
54
56
|
# rubocop:disable Style/RedundantBegin
|
55
57
|
@lock.synchronize do
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
58
|
+
# @note
|
59
|
+
# Previously we used exceptional flow "hash.fetch(key) rescue hash.fetch(key.to_sym)".
|
60
|
+
# This flow can generate a lot of useless objects during rescuable `KeyError` exception
|
61
|
+
# (useless error messages, backtraces, etc, object that was silently suppressed).
|
62
|
+
# So, the "if"-#key?-oriented flow is better (generates fewer number of objects statistically).
|
63
|
+
source.key?(key) ? source.fetch(key) : source.fetch(key.to_sym)
|
61
64
|
end
|
62
65
|
# rubocop:enable Style/RedundantBegin
|
63
66
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_schema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rustam Ibragimov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: smart_engine
|