Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve PriorityQueue documentation #49392

Merged
merged 1 commit into from
Mar 10, 2021

Conversation

eiriktsarpalis
Copy link
Member

Contributes to #43957.

@eiriktsarpalis eiriktsarpalis added documentation Documentation bug or enhancement, does not impact product or test code area-System.Collections labels Mar 9, 2021
@eiriktsarpalis eiriktsarpalis added this to the 6.0.0 milestone Mar 9, 2021
@eiriktsarpalis eiriktsarpalis self-assigned this Mar 9, 2021
@ghost
Copy link

ghost commented Mar 9, 2021

Tagging subscribers to this area: @eiriktsarpalis
See info in area-owners.md if you want to be subscribed.

Issue Details

Contributes to #43957.

Author: eiriktsarpalis
Assignees: eiriktsarpalis
Labels:

area-System.Collections, documentation

Milestone: 6.0.0

/// <typeparam name="TElement">Specifies the type of elements in the queue.</typeparam>
/// <typeparam name="TPriority">Specifies the type of priority associated with enqueued elements.</typeparam>
/// <remarks>
/// Implements an array-backed quaternary min-heap. Each element is enqueued with an associated priority
Copy link
Member

Choose a reason for hiding this comment

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

The array-backed and quarternary parts of this are implementation detail. Do they need to be in here? Are we guaranteeing that will be the case forever more?

Copy link
Member Author

Choose a reason for hiding this comment

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

Are we guaranteeing that will be the case forever more?

I'm thinking that this is more informational rather than a behaviour users would rely on. As such, we could always update the docs as we evolve the implementation without consequence.

@@ -8,11 +8,14 @@
namespace System.Collections.Generic
{
/// <summary>
/// Represents a data structure in which each element has an associated priority
/// that determines the order in which the pair is dequeued.
/// Represents a min priority queue.
Copy link
Member

Choose a reason for hiding this comment

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

Is this three space indent the intended formatting? We generally don't use that elsewhere to my knowledge.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure what the standard formatting is TBH. I expect that @carlossanlop's tool will eventually force a uniform style as we backport content from dotnet-api-docs.

Comment on lines +135 to +136
/// Constructs the heap using a heapify operation,
/// which is generally faster than enqueuing individual elements sequentially.
Copy link
Member

Choose a reason for hiding this comment

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

Needed?

Copy link
Member Author

@eiriktsarpalis eiriktsarpalis Mar 10, 2021

Choose a reason for hiding this comment

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

I'm assuming most users would want to know what differentiates this method over just calling Enqueue();Dequeue()

@eiriktsarpalis eiriktsarpalis merged commit 21c7397 into dotnet:main Mar 10, 2021
@eiriktsarpalis eiriktsarpalis deleted the priorityqueue-docs branch March 10, 2021 15:54
thaystg added a commit to thaystg/runtime that referenced this pull request Mar 10, 2021
* upstream/main: (83 commits)
  Fix a crash in llvm if the sreg of a setret is not set because the methods ends with a throw. (dotnet#49122)
  [macOS-arm64] Disable failing libraries tests (dotnet#49400)
  improve PriorityQueue documentation (dotnet#49392)
  [wasm] Fix debugger tests (dotnet#49206)
  [mono] Fix the emission of EnumEqualityComparer instances into the corlib AOT image. (dotnet#49402)
  jitutils M2M renaming reaction (dotnet#49430)
  WinHttpHandler: Read HTTP/2 trailing headers
  [RyuJIT] Make casthelpers cold for sealed classes (dotnet#49295)
  JIT: Non-void ThrowHelpers (dotnet#48589)
  Update package index for servicing (dotnet#49417)
  Remove unnecessary check on polymorphic serialization (dotnet#48464)
  Remove release build cron triggers from jitstress jobs (dotnet#49333)
  [main] Update dependencies from dotnet/arcade dotnet/llvm-project dotnet/runtime-assets (dotnet#49359)
  Implement AppleCryptoNative_X509GetRawData using SecCertificateCopyData
  [AndroidCrypto] Support a zero-length salt for HMACs. (dotnet#49384)
  Use managed implementation of pbkdf2 for Android's one-shot implementation. (dotnet#49314)
  Make 303 redirects do GET like Net Framework (dotnet#49095)
  Make sure event generation is incremental (dotnet#48903)
  Add amd and Surface arm64 perf runs (dotnet#49389)
  Enregister EH var that are single def (dotnet#47307)
  ...
@ghost ghost locked as resolved and limited conversation to collaborators Apr 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Collections documentation Documentation bug or enhancement, does not impact product or test code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants