Skip to content

Commit

Permalink
Use .insert_or_assign instead of operator[] or just .insert
Browse files Browse the repository at this point in the history
Signed-off-by: Lakira Ashley <[email protected]>
  • Loading branch information
LAK132 committed Jan 25, 2023
1 parent 106fceb commit 1f84c9e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/include/prjxray/xilinx/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,10 @@ Configuration<Spartan6>::InitWithPackets(const typename Spartan6::Part& part,

for (size_t ii = 0; ii < packet.data().size();
ii += ArchType::words_per_frame) {
frames[current_frame_address] =
frames.insert_or_assign(
current_frame_address,
packet.data().subspan(
ii, ArchType::words_per_frame);
ii, ArchType::words_per_frame));

auto next_address =
part.GetNextFrameAddress(
Expand Down Expand Up @@ -487,11 +488,10 @@ Configuration<ArchType>::InitWithPackets(const typename ArchType::Part& part,
// do auto-incrementing block writes.
for (size_t ii = 0; ii < packet.data().size();
ii += ArchType::words_per_frame) {
frames.insert(
{current_frame_address,
packet.data().subspan(
ii,
ArchType::words_per_frame)});
frames.insert_or_assign(
current_frame_address,
packet.data().subspan(
ii, ArchType::words_per_frame));

auto next_address =
part.GetNextFrameAddress(
Expand Down Expand Up @@ -523,9 +523,9 @@ Configuration<ArchType>::InitWithPackets(const typename ArchType::Part& part,
current_frame_address =
frame_address_register;
start_dup_write = false;
frames.insert(
{current_frame_address,
frames[last_write_frame_address]});
frames.insert_or_assign(
current_frame_address,
frames[last_write_frame_address]);
}
} break;
default:
Expand Down

0 comments on commit 1f84c9e

Please sign in to comment.