Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Stub out class #33

Merged
merged 4 commits into from
Mar 1, 2018
Merged

Stub out class #33

merged 4 commits into from
Mar 1, 2018

Conversation

decriptor
Copy link
Contributor

I'm somewhat guess at what we want here. Hopefully there is some useful stuff in here.

@decriptor decriptor requested review from Therzok and sundermann March 1, 2018 07:54
@Therzok Therzok merged commit eee2c5b into master Mar 1, 2018
@Therzok Therzok deleted the stub-out-class branch March 1, 2018 10:08

public static (string both, string names) BuildParameters(List<Parameter> parameters)
{
var typeAndName = new Dictionary<string, string>();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not preserve order!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good call!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would an OrderedDictionary fix this?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure but we don't really need a dictionary structure here, a list is sufficient since we don't care for fast lookups

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Therzok already fixed this in master

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

sb.AppendFormat("{0} {1}, ", pair.Key, pair.Value);
}
string parameterString = sb.ToString();
parameterString = parameterString.Substring(0, parameterString.Length - 2);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fail with no elements. I'm also not sure why to cut off everything but the last two characters. Did you wanted to cut off the trailing ", "?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll open a PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do want to cut the trailing ", " because that isn't valid c#.
ie, if I have 1 parameter string value it'll set parameterString to string value, . This is just trimming off that closing , .

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I misread that statement but anyway it fails when there are no parameters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, but this has also been rewritten in master :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sorry for not making a PR. Thought I was on a branch and pushed to master :(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants