@@ -786,39 +786,39 @@ HGraph::Deserialize(StreamReader& reader) {
786786 // try to deserialize footer (only in new version)
787787 auto footer = Footer::Parse (reader);
788788
789- BufferStreamReader buffer_reader (
790- &reader, std::numeric_limits<uint64_t >::max (), this ->allocator_ );
791-
792789 if (footer == nullptr ) { // old format, DON'T EDIT, remove in the future
793790 logger::debug (" parse with v0.14 version format" );
794791
795- this ->deserialize_basic_info_v0_14 (buffer_reader );
792+ this ->deserialize_basic_info_v0_14 (reader );
796793
797- this ->basic_flatten_codes_ ->Deserialize (buffer_reader );
798- this ->bottom_graph_ ->Deserialize (buffer_reader );
794+ this ->basic_flatten_codes_ ->Deserialize (reader );
795+ this ->bottom_graph_ ->Deserialize (reader );
799796 if (this ->use_reorder_ ) {
800- this ->high_precise_codes_ ->Deserialize (buffer_reader );
797+ this ->high_precise_codes_ ->Deserialize (reader );
801798 }
802799
803800 for (auto & route_graph : this ->route_graphs_ ) {
804- route_graph->Deserialize (buffer_reader );
801+ route_graph->Deserialize (reader );
805802 }
806803 auto new_size = max_capacity_.load ();
807804 this ->neighbors_mutex_ ->Resize (new_size);
808805
809806 pool_ = std::make_shared<VisitedListPool>(1 , allocator_, new_size, allocator_);
810807
811808 if (this ->extra_info_size_ > 0 && this ->extra_infos_ != nullptr ) {
812- this ->extra_infos_ ->Deserialize (buffer_reader );
809+ this ->extra_infos_ ->Deserialize (reader );
813810 }
814811 this ->total_count_ = this ->basic_flatten_codes_ ->TotalCount ();
815812
816813 if (this ->use_attribute_filter_ and this ->attr_filter_index_ != nullptr ) {
817- this ->attr_filter_index_ ->Deserialize (buffer_reader );
814+ this ->attr_filter_index_ ->Deserialize (reader );
818815 }
819816 } else { // create like `else if ( ver in [v0.15, v0.17] )` here if need in the future
820817 logger::debug (" parse with new version format" );
821818
819+ BufferStreamReader buffer_reader (
820+ &reader, std::numeric_limits<uint64_t >::max (), this ->allocator_ );
821+
822822 auto metadata = footer->GetMetadata ();
823823 // metadata should NOT be nullptr if footer is not nullptr
824824 this ->deserialize_basic_info (metadata->Get (" basic_info" ));
0 commit comments