Switches NotifyListenerVector to SmallVector (#1004)

This commit is contained in:
Thad House
2018-05-14 18:17:34 -07:00
committed by Peter Johnson
parent ab70220ecf
commit 406e18663d

View File

@@ -10,8 +10,8 @@
#ifndef __FRC_ROBORIO__
#include <memory>
#include <queue>
#include <vector>
#include <wpi/SmallVector.h>
#include "NotifyListener.h"
@@ -24,8 +24,8 @@ class HalCallbackListenerVectorImpl {
struct private_init {};
public:
typedef typename std::vector<HalCallbackListener<ListenerType>>::size_type
size_type;
typedef typename wpi::SmallVectorImpl<
HalCallbackListener<ListenerType>>::size_type size_type;
// Constructor for creating copies of the vector
HalCallbackListenerVectorImpl(const HalCallbackListenerVectorImpl* copyFrom,
@@ -64,8 +64,8 @@ class HalCallbackListenerVectorImpl {
unsigned int uid);
private:
std::vector<HalCallbackListener<ListenerType>> m_vector;
std::vector<unsigned int> m_free;
wpi::SmallVector<HalCallbackListener<ListenerType>, 4> m_vector;
wpi::SmallVector<unsigned int, 4> m_free;
// Add a new NotifyListener to the vector. If there are elements on the
// freelist,