diff --git a/.azure-pipelines/build-docker-sonic-vs-template.yml b/.azure-pipelines/build-docker-sonic-vs-template.yml index aa27bca9f..ce539171e 100644 --- a/.azure-pipelines/build-docker-sonic-vs-template.yml +++ b/.azure-pipelines/build-docker-sonic-vs-template.yml @@ -29,7 +29,7 @@ jobs: timeoutInMinutes: ${{ parameters.timeout }} pool: - vmImage: 'ubuntu-20.04' + vmImage: 'ubuntu-22.04' steps: - checkout: self diff --git a/.azure-pipelines/build-sairedis-template.yml b/.azure-pipelines/build-sairedis-template.yml index 49bb7d9ae..00cdd0601 100644 --- a/.azure-pipelines/build-sairedis-template.yml +++ b/.azure-pipelines/build-sairedis-template.yml @@ -46,7 +46,7 @@ jobs: ${{ if ne(parameters.pool, 'default') }}: name: ${{ parameters.pool }} ${{ else }}: - vmImage: 'ubuntu-20.04' + vmImage: 'ubuntu-22.04' container: image: sonicdev-microsoft.azurecr.io:443/${{ parameters.sonic_slave }} diff --git a/.azure-pipelines/build-swss-template.yml b/.azure-pipelines/build-swss-template.yml index a9c19bfcb..b964d75b9 100644 --- a/.azure-pipelines/build-swss-template.yml +++ b/.azure-pipelines/build-swss-template.yml @@ -42,7 +42,7 @@ jobs: ${{ if ne(parameters.pool, 'default') }}: name: ${{ parameters.pool }} ${{ else }}: - vmImage: 'ubuntu-20.04' + vmImage: 'ubuntu-22.04' container: image: sonicdev-microsoft.azurecr.io:443/${{ parameters.sonic_slave }} diff --git a/.azure-pipelines/build-template.yml b/.azure-pipelines/build-template.yml index f2a0ee496..3c50b9199 100644 --- a/.azure-pipelines/build-template.yml +++ b/.azure-pipelines/build-template.yml @@ -50,7 +50,7 @@ jobs: ${{ if ne(parameters.pool, 'default') }}: name: ${{ parameters.pool }} ${{ else }}: - vmImage: 'ubuntu-20.04' + vmImage: 'ubuntu-22.04' container: image: sonicdev-microsoft.azurecr.io:443/${{ parameters.sonic_slave }} diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4ac382234..30784f353 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -53,9 +53,9 @@ stages: jobs: - job: - displayName: "amd64/ubuntu-20.04" + displayName: "amd64/ubuntu-22.04" pool: - vmImage: 'ubuntu-20.04' + vmImage: 'ubuntu-22.04' steps: - script: | diff --git a/common/events.cpp b/common/events.cpp index 7c4f4eddd..b2c0d7ea4 100644 --- a/common/events.cpp +++ b/common/events.cpp @@ -365,7 +365,7 @@ EventSubscriber::init(bool use_cache, int recv_timeout, RET_ON_ERR(rc == 0, "Fails to set option rc=%d", rc); } else { - for (const auto e: *subs_sources) { + for (const auto& e: *subs_sources) { rc = zmq_setsockopt(sock, ZMQ_SUBSCRIBE, e.c_str(), e.size()); RET_ON_ERR(rc == 0, "Fails to set option rc=%d", rc); } @@ -400,14 +400,14 @@ EventSubscriber::prune_track() map > lst; /* Sort entries by last touched time */ - for(const auto e: m_track) { + for(const auto& e: m_track) { lst[e.second.epoch_secs].push_back(e.first); } /* By default it walks from lowest value / earliest timestamp */ map >::const_iterator itc = lst.begin(); for(; (itc != lst.end()) && (m_track.size() > MAX_PUBLISHERS_COUNT); ++itc) { - for (const auto r: itc->second) { + for (const auto& r: itc->second) { m_track.erase(r); } } diff --git a/tests/events_ut.cpp b/tests/events_ut.cpp index ae9c684bc..4850c0b49 100644 --- a/tests/events_ut.cpp +++ b/tests/events_ut.cpp @@ -137,7 +137,7 @@ parse_read_evt(string &source, internal_event_t &evt, EXPECT_FALSE(source.empty()); EXPECT_EQ(4, evt.size()); - for (const auto e: evt) { + for (const auto& e: evt) { if (e.first == EVENT_STR_DATA) { EXPECT_EQ(0, convert_from_json(e.second, key, params)); // cout << "EVENT_STR_DATA: " << e.second << "\n";