Code Monkey home page Code Monkey logo

Comments (9)

Qix- avatar Qix- commented on May 24, 2024 1

Alright, hopefully that solves that :)

from tortellini.

FranckRJ avatar FranckRJ commented on May 24, 2024

You should just use std::equal.

from tortellini.

Qix- avatar Qix- commented on May 24, 2024

Fantastic catch, that would have caused some headache later.

Thank you very much.

from tortellini.

FranckRJ avatar FranckRJ commented on May 24, 2024

e62d812#diff-f018793c8a8f1398780f8e4e1e82e39fR120

You should keep r.end(), because otherwise std::equal will go past the end of r if it's smaller than l. In your code it will never happen because it require that l contain a \0 in the middle of the string (std::string support this) but better safe than sorry.

(@Qix- not sure if you will receive a notification for this comment because the issue is already closed so i tag you, and thanks for the rewards on reddit)

from tortellini.

Qix- avatar Qix- commented on May 24, 2024

It wouldn't compile for me when I tried - I'll try again.

And no problem, I appreciate the review very much. :)

from tortellini.

Qix- avatar Qix- commented on May 24, 2024

That overload of std::equal isn't available until c++17 c++14 it appears.

Will do some more research.

from tortellini.

FranckRJ avatar FranckRJ commented on May 24, 2024

You can just check that l.size() == r.size() before calling std::equal if you don't use C++14.

from tortellini.

Qix- avatar Qix- commented on May 24, 2024

Man I really must be tired, that is a much better solution.

from tortellini.

Qix- avatar Qix- commented on May 24, 2024

By the way, usually you still get notifications on github even after an issue is closed. Once you participate in an issue/PR you have to manually opt-out with the notifications button on the right; the issue status doesn't affect your notifications :)

Thanks again!

from tortellini.

Related Issues (9)

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.