Skip to content

Commit 4f62040

Browse files
author
Artyom Abakumov
committed
Use better name for impure string make method
1 parent 2f459bb commit 4f62040

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/jrd/evl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ void EVL_make_value(thread_db* tdbb, const dsc* desc, impure_value* value, Memor
576576
if (!pool)
577577
pool = tdbb->getDefaultPool();
578578

579-
VaryingString* string = value->getAllocateString(from.dsc_length, *pool);
579+
VaryingString* string = value->getString(*pool, length);
580580

581581
value->vlu_desc.dsc_length = length;
582582
UCHAR* target = string->str_data;

src/jrd/val.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ struct impure_value
170170
void make_decimal_fixed(const Firebird::Int128 val, const signed char scale);
171171

172172
template<class T>
173-
VaryingString* getAllocateString(T requeuedLength, MemoryPool& pool) = delete; // Prevent dangerous length shrink
174-
VaryingString* getAllocateString(USHORT requeuedLength, MemoryPool& pool);
173+
VaryingString* getString(MemoryPool& pool, const T length) = delete; // Prevent dangerous length shrink
174+
VaryingString* getString(MemoryPool& pool, const USHORT length);
175175

176176
void makeImpureDscAddress(MemoryPool& pool);
177177
void allocateTextImpureDscAddress(MemoryPool& pool);
@@ -228,18 +228,18 @@ inline void impure_value::make_decimal_fixed(const Firebird::Int128 val, const s
228228
this->vlu_desc.dsc_address = reinterpret_cast<UCHAR*>(&this->vlu_misc.vlu_int128);
229229
}
230230

231-
inline VaryingString* impure_value::getAllocateString(USHORT requeuedLength, MemoryPool& pool)
231+
inline VaryingString* impure_value::getString(MemoryPool& pool, const USHORT length)
232232
{
233-
if (vlu_string && vlu_string->str_length < requeuedLength)
233+
if (vlu_string && vlu_string->str_length < length)
234234
{
235235
delete vlu_string;
236236
vlu_string = nullptr;
237237
}
238238

239239
if (!vlu_string)
240240
{
241-
vlu_string = FB_NEW_RPT(pool, requeuedLength) VaryingString();
242-
vlu_string->str_length = requeuedLength;
241+
vlu_string = FB_NEW_RPT(pool, length) VaryingString();
242+
vlu_string->str_length = length;
243243
}
244244

245245
return vlu_string;
@@ -258,7 +258,7 @@ inline void impure_value::makeImpureDscAddress(MemoryPool& pool)
258258

259259
inline void impure_value::allocateTextImpureDscAddress(MemoryPool& pool)
260260
{
261-
vlu_desc.dsc_address = getAllocateString(vlu_desc.dsc_length, pool)->str_data;
261+
vlu_desc.dsc_address = getString(pool, vlu_desc.dsc_length)->str_data;
262262
}
263263

264264

0 commit comments

Comments
 (0)