Skip to content

Commit

Permalink
jobs: optimise stack usage of strings
Browse files Browse the repository at this point in the history
  • Loading branch information
BogdanTheGeek committed Dec 15, 2023
1 parent f00ec58 commit 532789d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/jobs.c
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ size_t Jobs_UpdateMsg( JobCurrentStatus_t status,
char * buffer,
size_t bufferSize )
{
const char * const jobStatusString[ 5U ] =
static const char * const jobStatusString[ 5U ] =
{
"QUEUED",
"IN_PROGRESS",
Expand All @@ -819,7 +819,7 @@ size_t Jobs_UpdateMsg( JobCurrentStatus_t status,
"REJECTED"
};

const size_t jobStatusStringLengths[ 5U ] =
static const size_t jobStatusStringLengths[ 5U ] =
{
sizeof( "QUEUED" ) - 1U,
sizeof( "IN_PROGRESS" ) - 1U,
Expand Down Expand Up @@ -860,13 +860,13 @@ bool Jobs_IsJobUpdateStatus( const char * topic,
const size_t thingNameLength,
JobUpdateStatus_t expectedStatus )
{
const char * const jobUpdateStatusString[ 2U ] =
static const char * const jobUpdateStatusString[ 2U ] =
{
"accepted",
"rejected"
};

const size_t jobUpdateStatusStringLengths[ 2U ] =
static const size_t jobUpdateStatusStringLengths[ 2U ] =
{
sizeof( "accepted" ) - 1U,
sizeof( "rejected" ) - 1U
Expand Down

0 comments on commit 532789d

Please sign in to comment.