[wpilibc] Use LLVM containers in ShuffleboardInstance (#2658)

This commit is contained in:
Tyler Veness
2020-08-27 20:45:14 -07:00
committed by GitHub
parent 0d88213de5
commit 148f43b4a5
2 changed files with 7 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -10,6 +10,7 @@
#include <hal/FRCUsageReporting.h>
#include <networktables/NetworkTable.h>
#include <networktables/NetworkTableInstance.h>
#include <wpi/SmallVector.h>
#include <wpi/StringMap.h>
#include "frc/shuffleboard/Shuffleboard.h"
@@ -43,7 +44,7 @@ frc::ShuffleboardTab& ShuffleboardInstance::GetTab(wpi::StringRef title) {
void ShuffleboardInstance::Update() {
if (m_impl->tabsChanged) {
std::vector<std::string> tabTitles;
wpi::SmallVector<std::string, 16> tabTitles;
for (auto& entry : m_impl->tabs) {
tabTitles.emplace_back(entry.second.GetTitle());
}

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -20,6 +20,9 @@ class ShuffleboardInstance final : public ShuffleboardRoot {
explicit ShuffleboardInstance(nt::NetworkTableInstance ntInstance);
virtual ~ShuffleboardInstance();
ShuffleboardInstance(ShuffleboardInstance&&) = default;
ShuffleboardInstance& operator=(ShuffleboardInstance&&) = default;
frc::ShuffleboardTab& GetTab(wpi::StringRef title) override;
void Update() override;