Skip to content

Commit 0fcd42f

Browse files
committed
fix: review issues
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
1 parent 46f1c35 commit 0fcd42f

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

include/scale/scale_decoder_stream.hpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@
1717
#include <boost/variant.hpp>
1818

1919
#include <scale/bitvec.hpp>
20-
#include <scale/detail/compact_integer.hpp>
2120
#include <scale/detail/fixed_width_integer.hpp>
21+
#ifdef JAM_COMPATIBILITY_ENABLED
2222
#include <scale/detail/jam_compact_integer.hpp>
23+
#else
24+
#include <scale/detail/compact_integer.hpp>
25+
#endif
2326
#include <scale/scale_error.hpp>
2427
#include <scale/types.hpp>
2528
#include <type_traits>
@@ -370,8 +373,8 @@ namespace scale {
370373
if (not config_.has_value()) {
371374
throw std::runtime_error("Stream created without any custom config");
372375
}
373-
if (config_.type().hash_code()
374-
!= typeid(std::reference_wrapper<const T>).hash_code()) {
376+
if (config_.type()
377+
!= typeid(std::reference_wrapper<const T>)) {
375378
throw std::runtime_error("Stream created with other custom config");
376379
}
377380
return std::any_cast<std::reference_wrapper<const T>>(config_).get();
@@ -380,7 +383,7 @@ namespace scale {
380383
template <typename T>
381384
[[deprecated("Scale has compiled without custom config support")]] //
382385
const T &
383-
getConfig_() const = delete;
386+
getConfig() const = delete;
384387
#endif
385388

386389
private:

include/scale/scale_encoder_stream.hpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616
#include <boost/variant.hpp>
1717

1818
#include <scale/bitvec.hpp>
19-
#include <scale/detail/compact_integer.hpp>
2019
#include <scale/detail/fixed_width_integer.hpp>
20+
#ifdef JAM_COMPATIBILITY_ENABLED
2121
#include <scale/detail/jam_compact_integer.hpp>
22+
#else
23+
#include <scale/detail/compact_integer.hpp>
24+
#endif
2225
#include <scale/scale_error.hpp>
2326
#include <scale/tune.hpp>
2427
#include <scale/types.hpp>
@@ -259,8 +262,8 @@ namespace scale {
259262
if (not config_.has_value()) {
260263
throw std::runtime_error("Stream created without any custom config");
261264
}
262-
if (config_.type().hash_code()
263-
!= typeid(std::reference_wrapper<const T>).hash_code()) {
265+
if (config_.type()
266+
!= typeid(std::reference_wrapper<const T>)) {
264267
throw std::runtime_error("Stream created with other custom config");
265268
}
266269
return std::any_cast<std::reference_wrapper<const T>>(config_).get();
@@ -356,4 +359,4 @@ namespace scale {
356359
return s << static_cast<std::underlying_type_t<E>>(v);
357360
}
358361

359-
} // namespace scale
362+
} // namespace scale

src/scale_decoder_stream.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
#include <scale/scale_decoder_stream.hpp>
88

9-
#include <scale/detail/fixed_width_integer.hpp>
10-
#include <scale/detail/jam_compact_integer.hpp>
11-
129
namespace scale {
1310
size_t ScaleDecoderStream::decodeLength() {
1411
#ifdef JAM_COMPATIBILITY_ENABLED

src/scale_encoder_stream.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
#include <scale/scale_encoder_stream.hpp>
88

9-
#include <scale/detail/fixed_width_integer.hpp>
10-
#include <scale/detail/jam_compact_integer.hpp>
11-
129
namespace scale {
1310
ScaleEncoderStream::ScaleEncoderStream()
1411
: drop_data_{false}, bytes_written_{0} {}

0 commit comments

Comments
 (0)