Skip to content

Commit 0f0ab5a

Browse files
committed
tidy code
1 parent 2a10360 commit 0f0ab5a

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

include/jsoncons_ext/ubjson/ubjson_encoder.hpp

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,17 @@ class basic_ubjson_encoder final : public basic_json_visitor<char>
100100
nesting_depth_(0)
101101
{
102102
}
103-
104-
~basic_ubjson_encoder() = default;
103+
104+
~basic_ubjson_encoder() noexcept
105+
{
106+
JSONCONS_TRY
107+
{
108+
sink_.flush();
109+
}
110+
JSONCONS_CATCH(...)
111+
{
112+
}
113+
}
105114

106115
basic_ubjson_encoder& operator=(const basic_ubjson_encoder&) = delete;
107116
basic_ubjson_encoder& operator=(basic_ubjson_encoder&&) = delete;
@@ -118,17 +127,6 @@ class basic_ubjson_encoder final : public basic_json_visitor<char>
118127
reset();
119128
}
120129

121-
~basic_ubjson_encoder() noexcept
122-
{
123-
JSONCONS_TRY
124-
{
125-
sink_.flush();
126-
}
127-
JSONCONS_CATCH(...)
128-
{
129-
}
130-
}
131-
132130
private:
133131
// Implementing methods
134132

0 commit comments

Comments
 (0)