Giter VIP home page Giter VIP logo

Comments (3)

jhugard avatar jhugard commented on June 27, 2024

Yup, looks like a bug & looks like your proposed fix should work. Sloppy of me to not have unit tested this. Feel free to add a test, update the code & send a pull request. Will otherwise try to get to this in a couple of days...

On a note, I'm not entirely happy with this particular routine. I had tried to eliminate construction of the throw-away ref object here by refactoring the entire library to use pass-by-reference (byref) - see this branch: https://github.com/ctaggart/froto/tree/pass-by-reference-and-record-serializer. Would be great to get that working, but I don't think it is possible to eliminate the runtime-error because .NET simply does not support byref and generic parameters

from froto.

jhugard avatar jhugard commented on June 27, 2024

I've fixed the above & added a unit test, but there is now an O(n^2) performance issue.

While writing the unit tests, I noticed that repeated fields were not being kept in order (packed-repeated works, though). As a quick fix, hydrateRepeated does an append to the end of the list for every new element added.

Not sure how to fix this long term without adding additional abstract methods to MessageBase, but that's probably going to be the solution.

from froto.

jhugard avatar jhugard commented on June 27, 2024

@tathanhdinh - please update your client code to rename hydrateRepeated to hydrateOneRepeatedInstance. Sorry for the inconvenience, but even I was confused at first, thinking that this function would deserialize the entire list of repeated objects (not just a single instance).

from froto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.