@@ -380,7 +380,7 @@ string Jrd::Attachment::stringToUserCharSet(thread_db* tdbb, const string& str)
380
380
return str;
381
381
382
382
HalfStaticArray<UCHAR, BUFFER_MEDIUM> buffer (str.length () * sizeof (ULONG));
383
- ULONG len = INTL_convert_bytes (tdbb, att_charset, buffer.begin (), buffer.getCapacity (),
383
+ const ULONG len = INTL_convert_bytes (tdbb, att_charset, buffer.begin (), buffer.getCapacity (),
384
384
CS_METADATA, (const BYTE*) str.c_str (), str.length (), ERR_post);
385
385
386
386
return string ((char *) buffer.begin (), len);
@@ -454,8 +454,8 @@ static void runDBTriggers(thread_db* tdbb, TriggerAction action)
454
454
{
455
455
fb_assert (action == TRIGGER_CONNECT || action == TRIGGER_DISCONNECT);
456
456
457
- Database* dbb = tdbb->getDatabase ();
458
- Attachment* att = tdbb->getAttachment ();
457
+ const Database* dbb = tdbb->getDatabase ();
458
+ const Attachment* att = tdbb->getAttachment ();
459
459
fb_assert (dbb);
460
460
fb_assert (att);
461
461
@@ -641,7 +641,7 @@ void Jrd::Attachment::mergeStats(bool pageStatsOnly)
641
641
}
642
642
643
643
644
- bool Attachment::hasActiveRequests () const
644
+ bool Attachment::hasActiveRequests () const noexcept
645
645
{
646
646
for (const jrd_tra* transaction = att_transactions;
647
647
transaction; transaction = transaction->tra_next )
@@ -661,7 +661,7 @@ bool Attachment::hasActiveRequests() const
661
661
// Find an inactive incarnation of a system request. If necessary, clone it.
662
662
Request* Jrd::Attachment::findSystemRequest (thread_db* tdbb, USHORT id, USHORT which)
663
663
{
664
- static const int MAX_RECURSION = 100 ;
664
+ constexpr int MAX_RECURSION = 100 ;
665
665
666
666
// If the request hasn't been compiled or isn't active, there're nothing to do.
667
667
@@ -1084,7 +1084,7 @@ unsigned int Attachment::getActualIdleTimeout() const
1084
1084
1085
1085
void Attachment::setupIdleTimer (bool clear)
1086
1086
{
1087
- unsigned int timeout = clear ? 0 : getActualIdleTimeout ();
1087
+ const unsigned int timeout = clear ? 0 : getActualIdleTimeout ();
1088
1088
if (!timeout || hasActiveRequests ())
1089
1089
{
1090
1090
if (att_idle_timer)
@@ -1187,7 +1187,7 @@ ProfilerManager* Attachment::getProfilerManager(thread_db* tdbb)
1187
1187
1188
1188
ProfilerManager* Attachment::getActiveProfilerManagerForNonInternalStatement (thread_db* tdbb)
1189
1189
{
1190
- const auto request = tdbb->getRequest ();
1190
+ const auto * request = tdbb->getRequest ();
1191
1191
1192
1192
return isProfilerActive () && !request->hasInternalStatement () ?
1193
1193
getProfilerManager (tdbb) :
0 commit comments