mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-04-20 22:00:02 +02:00
resize before read
This commit is contained in:
parent
92f5421481
commit
e71569b15e
@ -229,6 +229,7 @@ ClusterFile<ClusterType, Enable>::read_clusters_without_cut(size_t n_clusters) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ClusterVector<ClusterType> clusters(n_clusters);
|
ClusterVector<ClusterType> clusters(n_clusters);
|
||||||
|
clusters.resize(n_clusters);
|
||||||
|
|
||||||
int32_t iframe = 0; // frame number needs to be 4 bytes!
|
int32_t iframe = 0; // frame number needs to be 4 bytes!
|
||||||
size_t nph_read = 0;
|
size_t nph_read = 0;
|
||||||
@ -283,7 +284,7 @@ template <typename ClusterType, typename Enable>
|
|||||||
ClusterVector<ClusterType>
|
ClusterVector<ClusterType>
|
||||||
ClusterFile<ClusterType, Enable>::read_clusters_with_cut(size_t n_clusters) {
|
ClusterFile<ClusterType, Enable>::read_clusters_with_cut(size_t n_clusters) {
|
||||||
ClusterVector<ClusterType> clusters;
|
ClusterVector<ClusterType> clusters;
|
||||||
clusters.reserve(n_clusters);
|
clusters.resize(n_clusters);
|
||||||
|
|
||||||
// if there are photons left from previous frame read them first
|
// if there are photons left from previous frame read them first
|
||||||
if (m_num_left) {
|
if (m_num_left) {
|
||||||
|
@ -299,7 +299,7 @@ class ClusterVector<Cluster<T, ClusterSizeX, ClusterSizeY, CoordType>> {
|
|||||||
*/
|
*/
|
||||||
ClusterVector(size_t capacity = 1024, uint64_t frame_number = 0)
|
ClusterVector(size_t capacity = 1024, uint64_t frame_number = 0)
|
||||||
: m_frame_number(frame_number) {
|
: m_frame_number(frame_number) {
|
||||||
m_data.resize(capacity);
|
m_data.reserve(capacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move constructor
|
// Move constructor
|
||||||
|
Loading…
x
Reference in New Issue
Block a user