@@ -380,7 +380,7 @@ string Jrd::Attachment::stringToUserCharSet(thread_db* tdbb, const string& str)
380380 return str;
381381
382382 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 (),
384384 CS_METADATA, (const BYTE*) str.c_str (), str.length (), ERR_post);
385385
386386 return string ((char *) buffer.begin (), len);
@@ -454,8 +454,8 @@ static void runDBTriggers(thread_db* tdbb, TriggerAction action)
454454{
455455 fb_assert (action == TRIGGER_CONNECT || action == TRIGGER_DISCONNECT);
456456
457- Database* dbb = tdbb->getDatabase ();
458- Attachment* att = tdbb->getAttachment ();
457+ const Database* dbb = tdbb->getDatabase ();
458+ const Attachment* att = tdbb->getAttachment ();
459459 fb_assert (dbb);
460460 fb_assert (att);
461461
@@ -641,7 +641,7 @@ void Jrd::Attachment::mergeStats(bool pageStatsOnly)
641641}
642642
643643
644- bool Attachment::hasActiveRequests () const
644+ bool Attachment::hasActiveRequests () const noexcept
645645{
646646 for (const jrd_tra* transaction = att_transactions;
647647 transaction; transaction = transaction->tra_next )
@@ -661,7 +661,7 @@ bool Attachment::hasActiveRequests() const
661661// Find an inactive incarnation of a system request. If necessary, clone it.
662662Request* Jrd::Attachment::findSystemRequest (thread_db* tdbb, USHORT id, USHORT which)
663663{
664- static const int MAX_RECURSION = 100 ;
664+ constexpr int MAX_RECURSION = 100 ;
665665
666666 // If the request hasn't been compiled or isn't active, there're nothing to do.
667667
@@ -1084,7 +1084,7 @@ unsigned int Attachment::getActualIdleTimeout() const
10841084
10851085void Attachment::setupIdleTimer (bool clear)
10861086{
1087- unsigned int timeout = clear ? 0 : getActualIdleTimeout ();
1087+ const unsigned int timeout = clear ? 0 : getActualIdleTimeout ();
10881088 if (!timeout || hasActiveRequests ())
10891089 {
10901090 if (att_idle_timer)
@@ -1187,7 +1187,7 @@ ProfilerManager* Attachment::getProfilerManager(thread_db* tdbb)
11871187
11881188ProfilerManager* Attachment::getActiveProfilerManagerForNonInternalStatement (thread_db* tdbb)
11891189{
1190- const auto request = tdbb->getRequest ();
1190+ const auto * request = tdbb->getRequest ();
11911191
11921192 return isProfilerActive () && !request->hasInternalStatement () ?
11931193 getProfilerManager (tdbb) :
0 commit comments