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

REFACTOR: addedQ poll logic in handleInputQueue. #832

Closed
wants to merge 1 commit into from

Conversation

brido4125
Copy link
Collaborator

๐Ÿ”— Related Issue

โŒจ๏ธ What I did

addedQueue๋กœ๋ถ€ํ„ฐ poll์„ ํ•ด์˜ค๋Š” ๋กœ์ง์„ ๋ฆฌํŒฉํ† ๋ง ํ•˜์˜€์Šต๋‹ˆ๋‹ค.

while ๋ฃจํ”„์—์„œ๋งŒ ์‚ฌ์šฉ๋˜๋Š” node๋ผ๋Š” ์ง€์—ญ๋ณ€์ˆ˜ ์ œ๊ฑฐํ•˜๊ณ 
addedQueue.poll() != null์„ ํ†ตํ•ด ํ๊ฐ€ ๋น„์–ด์žˆ๋Š”์ง€
ํ™•์ธํ•˜๋˜ ๋กœ์ง์„ isEmpty๋กœ ์ฒ˜๋ฆฌํ•˜์—ฌ ์ฝ๊ธฐ ์‰ฝ๊ฒŒ ๋ฐ”๊ฟจ์Šต๋‹ˆ๋‹ค.

@brido4125 brido4125 self-assigned this Oct 18, 2024
@jhpark816 jhpark816 removed the request for review from oliviarla October 18, 2024 02:35
@@ -825,45 +825,42 @@ private void handleDelayedSwitchover() {

// Handle any requests that have been made against the client.
private void handleInputQueue() {
if (!addedQueue.isEmpty()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

๊ธฐ์กด์—๋Š” addedQueue.isEmpty()์ธ ๊ฒฝ์šฐ ์•„๋ฌด๋Ÿฐ ๋กœ์ง์„ ์ˆ˜ํ–‰ํ•˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.
ํ˜„์žฌ๋Š” ์ผ๋ถ€ ๊ฐ์ฒด๋ฅผ ์ƒ์„ฑํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
addedQueue.isEmpty() == true์ธ ๊ฒฝ์šฐ ํ•จ์ˆ˜๋ฅผ ๋น ์ ธ๋‚˜๊ฐ€๋„๋ก returnํ•˜๋Š” ์กฐ๊ฑด๋ฌธ์„ ์ถ”๊ฐ€ํ•ฉ์‹œ๋‹ค.

@jhpark816
Copy link
Collaborator

jhpark816 commented Oct 18, 2024

@brido4125
๊ธฐ์กด ์ฝ”๋“œ๊ฐ€ ๋‚ซ๋‹ค๊ณ  ๋ด…๋‹ˆ๋‹ค.

  • ๊ธฐ์กด ์ฝ”๋“œ๋Š” addedQueue.isEmpty() ์ด๋ฉด ๋ฐ”๋กœ ๋ฆฌํ„ด
  • ๊ธฐ์กด ์ฝ”๋“œ๋Š” ๋งค๋ฒˆ addedQueue.poll() ๋งŒ ํ˜ธ์ถœํ•˜๋ฉด ๋˜์ง€๋งŒ
    ์ˆ˜์ • ์ฝ”๋“œ๋Š” ๋งค๋ฒˆ addedQueue.isEmpty()์™€ addedQueue.poll()์„ ํ˜ธ์ถœํ•˜๊ณ  ์žˆ์Œ
  • Readability ์ฐจ์ด๊ฐ€ ์—†์Œ

@brido4125 brido4125 closed this Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants